diff --git a/mozilla/mailnews/base/resources/content/mail3PaneWindowCommands.js b/mozilla/mailnews/base/resources/content/mail3PaneWindowCommands.js index 6327d819357..9478e388bd2 100644 --- a/mozilla/mailnews/base/resources/content/mail3PaneWindowCommands.js +++ b/mozilla/mailnews/base/resources/content/mail3PaneWindowCommands.js @@ -716,35 +716,18 @@ function FocusRingUpdate_Mail() var currentFocusedElement = WhichPaneHasFocus(); if (!currentFocusedElement) return; - + if (currentFocusedElement != gLastFocusedElement) { - if( currentFocusedElement == GetThreadOutliner()) { - // XXX fix me - GetThreadOutliner().setAttribute("focusring","true"); - GetMessagePane().setAttribute("focusring","false"); - } + currentFocusedElement.setAttribute("focusring", "true"); + + if (gLastFocusedElement) + gLastFocusedElement.removeAttribute("focusring"); - else if(currentFocusedElement==GetFolderOutliner()) { - // XXX fix me - GetThreadOutliner().setAttribute("focusring","false"); - GetMessagePane().setAttribute("focusring","false"); - } - else if(currentFocusedElement==GetMessagePane()){ - // mscott --> fix me!! - GetThreadOutliner().setAttribute("focusring","false"); - GetMessagePane().setAttribute("focusring","true"); - } - else { - // XXX fix me - GetThreadOutliner().setAttribute("focusring","false"); - GetMessagePane().setAttribute("focusring","false"); - } - - gLastFocusedElement = currentFocusedElement; + gLastFocusedElement = currentFocusedElement; - // since we just changed the pane with focus we need to update the toolbar to reflect this - UpdateMailToolbar("focus"); - } + // since we just changed the pane with focus we need to update the toolbar to reflect this + UpdateMailToolbar("focus"); + } } function MessagePaneHasFocus() @@ -788,18 +771,18 @@ function IsSubWindowOf(search, wind) function WhichPaneHasFocus() { - var currentNode = top.document.commandDispatcher.focusedElement; - if (!currentNode) - return null; - var threadOutliner = GetThreadOutliner(); + var searchInput = GetSearchInput(); var folderOutliner = GetFolderOutliner(); - var messagePane = GetMessagePane(); + if (top.document.commandDispatcher.focusedWindow == GetMessagePaneFrame()) + return GetMessagePane(); + + var currentNode = top.document.commandDispatcher.focusedElement; while (currentNode) { if (currentNode === threadOutliner || - currentNode === folderOutliner || - currentNode === messagePane) + currentNode === searchInput || + currentNode === folderOutliner) return currentNode; currentNode = currentNode.parentNode; diff --git a/mozilla/mailnews/base/resources/content/msgMail3PaneWindow.js b/mozilla/mailnews/base/resources/content/msgMail3PaneWindow.js index 51acb077f56..a55896c4145 100644 --- a/mozilla/mailnews/base/resources/content/msgMail3PaneWindow.js +++ b/mozilla/mailnews/base/resources/content/msgMail3PaneWindow.js @@ -735,6 +735,14 @@ function GetFolderOutliner() return gFolderOutliner; } +function GetSearchInput() +{ + if (gSearchInput) return gSearchInput; + gSearchInput = document.getElementById("searchInput"); + return gSearchInput; +} + + function GetMessagePane() { if (gMessagePane) return gMessagePane;