1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

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
This commit is contained in:
Chris Smith
2009-08-15 20:44:53 +00:00
parent 0393a6232b
commit e63b12c4b1
3 changed files with 37 additions and 4 deletions

View File

@@ -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)