From a7bc2af4069eb0b5665a6855d2f48ee41e64ae35 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Tue, 19 Dec 2000 06:40:04 +0000 Subject: [PATCH] fix for #62904. get shift-tab to switch between panes counter clockwise. fix from blakeross@telocity.com. r=sspitzer, sr=bienvenu --- .../content/mail3PaneWindowCommands.js | 38 +++++++------------ .../resources/content/mailWindowOverlay.xul | 5 ++- 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/mailnews/base/resources/content/mail3PaneWindowCommands.js b/mailnews/base/resources/content/mail3PaneWindowCommands.js index 3ed024a0df6..ad6502f56ee 100644 --- a/mailnews/base/resources/content/mail3PaneWindowCommands.js +++ b/mailnews/base/resources/content/mail3PaneWindowCommands.js @@ -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'); } diff --git a/mailnews/base/resources/content/mailWindowOverlay.xul b/mailnews/base/resources/content/mailWindowOverlay.xul index 3e68a9880ec..0061e12f06a 100644 --- a/mailnews/base/resources/content/mailWindowOverlay.xul +++ b/mailnews/base/resources/content/mailWindowOverlay.xul @@ -150,7 +150,10 @@ Rights Reserved. - + + +