зеркало из https://github.com/mozilla/pjs.git
Bug 203386 CTRL+TAB navigation inconsistent when focus is not on one of the three main panes p=mcow@well.com r=me sr=mscott
This commit is contained in:
Родитель
4ef6f59981
Коммит
028f46c57e
|
@ -724,11 +724,10 @@ function FocusRingUpdate_Mail()
|
|||
// we really only care about nsFocusController::Focus() happens,
|
||||
// which calls nsFocusController::SetFocusedElement(element)
|
||||
var currentFocusedElement = WhichPaneHasFocus();
|
||||
if (!currentFocusedElement)
|
||||
return;
|
||||
|
||||
if (currentFocusedElement != gLastFocusedElement) {
|
||||
currentFocusedElement.setAttribute("focusring", "true");
|
||||
if (currentFocusedElement)
|
||||
currentFocusedElement.setAttribute("focusring", "true");
|
||||
|
||||
if (gLastFocusedElement)
|
||||
gLastFocusedElement.removeAttribute("focusring");
|
||||
|
@ -746,7 +745,6 @@ function FocusRingUpdate_Mail()
|
|||
function WhichPaneHasFocus()
|
||||
{
|
||||
var threadTree = GetThreadTree();
|
||||
var searchInput = GetSearchInput();
|
||||
var folderTree = GetFolderTree();
|
||||
var messagePane = GetMessagePane();
|
||||
|
||||
|
@ -756,7 +754,6 @@ function WhichPaneHasFocus()
|
|||
var currentNode = top.document.commandDispatcher.focusedElement;
|
||||
while (currentNode) {
|
||||
if (currentNode === threadTree ||
|
||||
currentNode === searchInput ||
|
||||
currentNode === folderTree ||
|
||||
currentNode === messagePane)
|
||||
return currentNode;
|
||||
|
@ -1053,17 +1050,22 @@ function SearchBarToggled()
|
|||
|
||||
function SwitchPaneFocus(event)
|
||||
{
|
||||
var focusedElement = WhichPaneHasFocus();
|
||||
var folderTree = GetFolderTree();
|
||||
var threadTree = GetThreadTree();
|
||||
var searchInput = GetSearchInput();
|
||||
var messagePane = GetMessagePane();
|
||||
|
||||
// Although internally this is actually a four-pane window, it is presented as
|
||||
// a three-pane -- the search pane is more of a toolbar. So, shift among the
|
||||
// three main panes.
|
||||
|
||||
var focusedElement = WhichPaneHasFocus();
|
||||
if (focusedElement == null) // focus not on one of the main three panes?
|
||||
focusedElement = threadTree; // treat as if on thread tree
|
||||
|
||||
if (event && event.shiftKey)
|
||||
{
|
||||
if (focusedElement == threadTree && searchInput.parentNode.getAttribute('hidden') != 'true')
|
||||
searchInput.focus();
|
||||
else if ((focusedElement == threadTree || focusedElement == searchInput) && !IsFolderPaneCollapsed())
|
||||
// Reverse traversal: Message -> Thread -> Folder -> Message
|
||||
if (focusedElement == threadTree && !IsFolderPaneCollapsed())
|
||||
folderTree.focus();
|
||||
else if (focusedElement != messagePane && !IsMessagePaneCollapsed())
|
||||
SetFocusMessagePane();
|
||||
|
@ -1072,14 +1074,11 @@ function SwitchPaneFocus(event)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (focusedElement == searchInput)
|
||||
threadTree.focus();
|
||||
else if (focusedElement == threadTree && !IsMessagePaneCollapsed())
|
||||
// Forward traversal: Folder -> Thread -> Message -> Folder
|
||||
if (focusedElement == threadTree && !IsMessagePaneCollapsed())
|
||||
SetFocusMessagePane();
|
||||
else if (focusedElement != folderTree && !IsFolderPaneCollapsed())
|
||||
folderTree.focus();
|
||||
else if (searchInput.parentNode.getAttribute('hidden') != 'true')
|
||||
searchInput.focus();
|
||||
else
|
||||
threadTree.focus();
|
||||
}
|
||||
|
@ -1099,8 +1098,10 @@ function SetFocusThreadPane()
|
|||
|
||||
function SetFocusMessagePane()
|
||||
{
|
||||
var messagePaneFrame = GetMessagePaneFrame();
|
||||
messagePaneFrame.focus();
|
||||
// XXX hack: to clear the focus on the previous element first focus
|
||||
// on the message pane element then focus on the main content window
|
||||
GetMessagePane().focus();
|
||||
GetMessagePaneFrame().focus();
|
||||
}
|
||||
|
||||
function is_collapsed(element)
|
||||
|
|
Загрузка…
Ссылка в новой задаче