зеркало из https://github.com/mozilla/pjs.git
fix for #62904. get shift-tab to switch between panes counter clockwise.
fix from blakeross@telocity.com. r=sspitzer, sr=bienvenu
This commit is contained in:
Родитель
39d185c247
Коммит
a7bc2af406
|
@ -915,19 +915,13 @@ function SetTemplateTreeItemOpen(open)
|
|||
}
|
||||
}
|
||||
|
||||
// global variable for the gray_vertical_splitter
|
||||
var gray_vertical_splitter_exists = false;
|
||||
|
||||
function SwitchPaneFocus(event)
|
||||
function SwitchPaneFocus(direction)
|
||||
{
|
||||
gray_vertical_splitter_exists = document.getElementById("gray_vertical_splitter");
|
||||
var focusedElement;
|
||||
var focusedElementId;
|
||||
//The first if statement is a check for the Shift+Tab -the else statement is for Tab
|
||||
if (event && (event.shiftKey))
|
||||
var gray_vertical_splitter = document.getElementById("gray_vertical_splitter");
|
||||
var focusedElement = document.commandDispatcher.focusedElement;
|
||||
var focusedElementId;
|
||||
if (direction == "counter-clockwise")
|
||||
{
|
||||
focusedElement = document.commandDispatcher.focusedElement;
|
||||
focusedElementId="";
|
||||
|
||||
if ( MessagePaneHasFocus() )
|
||||
SetFocusThreadPane();
|
||||
|
@ -938,9 +932,9 @@ function SwitchPaneFocus(event)
|
|||
focusedElementId = focusedElement.getAttribute('id');
|
||||
if(focusedElementId == "threadTree")
|
||||
{
|
||||
if (gray_vertical_splitter_exists)
|
||||
if (gray_vertical_splitter)
|
||||
{
|
||||
if (!(is_folderpane_collapsed()))
|
||||
if (!(is_collapsed(gray_vertical_splitter)))
|
||||
SetFocusFolderPane();
|
||||
else if(!(IsThreadAndMessagePaneSplitterCollapsed()))
|
||||
SetFocusMessagePane();
|
||||
|
@ -969,14 +963,12 @@ function SwitchPaneFocus(event)
|
|||
}
|
||||
else
|
||||
{
|
||||
focusedElement = document.commandDispatcher.focusedElement;
|
||||
focusedElementId="";
|
||||
|
||||
if ( MessagePaneHasFocus() )
|
||||
{
|
||||
if (gray_vertical_splitter_exists)
|
||||
if (gray_vertical_splitter)
|
||||
{
|
||||
if (!(is_folderpane_collapsed()))
|
||||
if (!(is_collapsed(gray_vertical_splitter)))
|
||||
SetFocusFolderPane();
|
||||
else
|
||||
SetFocusThreadPane();
|
||||
|
@ -998,9 +990,9 @@ function SwitchPaneFocus(event)
|
|||
{
|
||||
if (!(IsThreadAndMessagePaneSplitterCollapsed()))
|
||||
SetFocusMessagePane();
|
||||
else if (gray_vertical_splitter_exists)
|
||||
else if (gray_vertical_splitter)
|
||||
{
|
||||
if (!(is_folderpane_collapsed()))
|
||||
if (!(is_collapsed(gray_vertical_splitter)))
|
||||
SetFocusFolderPane();
|
||||
}
|
||||
else if (!(sidebar_is_collapsed()))
|
||||
|
@ -1037,12 +1029,8 @@ function SetFocusMessagePane()
|
|||
return;
|
||||
}
|
||||
|
||||
function is_folderpane_collapsed()
|
||||
function is_collapsed(element)
|
||||
{
|
||||
if (gray_vertical_splitter_exists)
|
||||
{
|
||||
return (gray_vertical_splitter_exists.getAttribute('state') == 'collapsed');
|
||||
}
|
||||
return false;
|
||||
return (element.getAttribute('state') == 'collapsed');
|
||||
}
|
||||
|
||||
|
|
|
@ -150,7 +150,10 @@ Rights Reserved.
|
|||
<key id="key_findAgain" key="&findAgainCmd.key;" observes="cmd_findAgain" modifiers="accel"/>
|
||||
|
||||
<!-- Tab Keys -->
|
||||
<key id="tabpane" keycode="VK_TAB" oncommand="SwitchPaneFocus(event)" />
|
||||
<key id="tabpaneCounterClockwise" keycode="VK_TAB" oncommand="SwitchPaneFocus('counter-clockwise');"
|
||||
modifiers="shift"/>
|
||||
<key id="tabpaneClockwise" keycode="VK_TAB" oncommand="SwitchPaneFocus('clockwise');"/>
|
||||
|
||||
|
||||
</keyset>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче