diff options
| author | Chris Smith <toonarmy@phpbb.com> | 2009-08-15 20:44:53 +0000 |
|---|---|---|
| committer | Chris Smith <toonarmy@phpbb.com> | 2009-08-15 20:44:53 +0000 |
| commit | e63b12c4b1487a683ced3b97f7414fa4f7bc58a8 (patch) | |
| tree | 6943c3abfed0f5ffd51f042bbf46e4cab7833c0e /phpBB/styles/prosilver/template | |
| parent | 0393a6232b5aa2b8764c50b40e2cb8b7b0803302 (diff) | |
| download | forums-e63b12c4b1487a683ced3b97f7414fa4f7bc58a8.tar forums-e63b12c4b1487a683ced3b97f7414fa4f7bc58a8.tar.gz forums-e63b12c4b1487a683ced3b97f7414fa4f7bc58a8.tar.bz2 forums-e63b12c4b1487a683ced3b97f7414fa4f7bc58a8.tar.xz forums-e63b12c4b1487a683ced3b97f7414fa4f7bc58a8.zip | |
Prevent style switcher from blocking the tab key. #49335
Tested under FF 3.0/3.5/Opera/Chrome on Linux
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9994 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/styles/prosilver/template')
| -rw-r--r-- | phpBB/styles/prosilver/template/overall_header.html | 2 | ||||
| -rw-r--r-- | phpBB/styles/prosilver/template/styleswitcher.js | 38 |
2 files changed, 36 insertions, 4 deletions
diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html index 9d4162591a..1ec9041b49 100644 --- a/phpBB/styles/prosilver/template/overall_header.html +++ b/phpBB/styles/prosilver/template/overall_header.html @@ -136,7 +136,7 @@ <ul class="linklist navlinks"> <li class="icon-home"><a href="{U_INDEX}" accesskey="h">{L_INDEX}</a> <!-- BEGIN navlinks --> <strong>‹</strong> <a href="{navlinks.U_VIEW_FORUM}">{navlinks.FORUM_NAME}</a><!-- END navlinks --></li> - <li class="rightside"><a href="#" onclick="fontsizeup(); return false;" onkeypress="fontsizeup(); return false;" class="fontsize" title="{L_CHANGE_FONT_SIZE}">{L_CHANGE_FONT_SIZE}</a></li> + <li class="rightside"><a href="#" onclick="fontsizeup(); return false;" onkeypress="return fontsizeup(event);" class="fontsize" title="{L_CHANGE_FONT_SIZE}">{L_CHANGE_FONT_SIZE}</a></li> <!-- IF U_EMAIL_TOPIC --><li class="rightside"><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}" class="sendemail">{L_EMAIL_TOPIC}</a></li><!-- ENDIF --> <!-- IF U_EMAIL_PM --><li class="rightside"><a href="{U_EMAIL_PM}" title="{L_EMAIL_PM}" class="sendemail">{L_EMAIL_PM}</a></li><!-- ENDIF --> diff --git a/phpBB/styles/prosilver/template/styleswitcher.js b/phpBB/styles/prosilver/template/styleswitcher.js index 203d8e4c21..b6ba1ecdae 100644 --- a/phpBB/styles/prosilver/template/styleswitcher.js +++ b/phpBB/styles/prosilver/template/styleswitcher.js @@ -1,6 +1,12 @@ -function fontsizeup() +function fontsizeup(event) { + // Skip tabs + if (event && getKeyCode(event) == 9) + { + return true; + } + var active = getActiveStyleSheet(); switch (active) @@ -29,11 +35,19 @@ function fontsizeup() setActiveStyleSheet('A'); break; } + + return false; } -function fontsizedown() +function fontsizedown(event) { - active = getActiveStyleSheet(); + // Skip tabs + if (event && getKeyCode(event) == 9) + { + return true; + } + + var active = getActiveStyleSheet(); switch (active) { @@ -60,6 +74,24 @@ function fontsizedown() setActiveStyleSheet('A--'); break; } + + return false; +} + +function getKeyCode(event) +{ + // IE doesn't fire the onkeypress event for tabs + // Reference: http://www.quirksmode.org/js/keys.html + + var code = (event.keyCode) ? event.keyCode : 0; + + // Probably using FF + if (!code && event.charCode) + { + code = event.charCode; + } + + return code; } function setActiveStyleSheet(title) |
