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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user