fix for bug#28520; keyboard navigation for mail;r=putterman;a=alecf

This commit is contained in:
varada%netscape.com 2000-09-22 02:51:23 +00:00
parent 28d129eb73
commit 7e5341a8a9
3 changed files with 72 additions and 13 deletions

View File

@ -17,7 +17,6 @@
* Copyright (C) 1998-2000 Netscape Communications Corporation. All
* Rights Reserved.
*/
// Controller object for folder pane
var FolderPaneController =
{
@ -940,14 +939,17 @@ function SetTemplateTreeItemOpen(open)
}
}
// global variable for the gray_vertical_splitter
var gray_vertical_splitter_exists = false;
function SwitchPaneFocus(event)
{
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))
{
dump("Inside the SwitchPaneFocus \n");
focusedElement = document.commandDispatcher.focusedElement;
focusedElementId="";
@ -959,9 +961,29 @@ function SwitchPaneFocus(event)
{
focusedElementId = focusedElement.getAttribute('id');
if(focusedElementId == "threadTree")
SetFocusFolderPane();
{
if (gray_vertical_splitter_exists)
{
if (!(is_folderpane_collapsed()))
SetFocusFolderPane();
else if(!(IsThreadAndMessagePaneSplitterCollapsed()))
SetFocusMessagePane();
}
else
{
if (!(sidebar_is_collapsed()))
SetFocusFolderPane();
else if(!(IsThreadAndMessagePaneSplitterCollapsed()))
SetFocusMessagePane();
}
}
else if(focusedElementId == "folderTree")
SetFocusMessagePane();
{
if (!(IsThreadAndMessagePaneSplitterCollapsed()))
SetFocusMessagePane();
else
SetFocusThreadPane();
}
}
catch(e)
{
@ -971,19 +993,44 @@ function SwitchPaneFocus(event)
}
else
{
dump("Inside the SwitchPaneFocus \n");
focusedElement = document.commandDispatcher.focusedElement;
focusedElementId="";
if ( MessagePaneHasFocus() )
SetFocusFolderPane();
{
if (gray_vertical_splitter_exists)
{
if (!(is_folderpane_collapsed()))
SetFocusFolderPane();
else
SetFocusThreadPane();
}
else
{
if (!(sidebar_is_collapsed()))
SetFocusFolderPane();
else
SetFocusThreadPane();
}
}
else
{
try
{
focusedElementId = focusedElement.getAttribute('id');
if(focusedElementId == "threadTree")
SetFocusMessagePane();
{
if (!(IsThreadAndMessagePaneSplitterCollapsed()))
SetFocusMessagePane();
else if (gray_vertical_splitter_exists)
{
if (!(is_folderpane_collapsed()))
SetFocusFolderPane();
}
else if (!(sidebar_is_collapsed()))
SetFocusFolderPane();
}
else if(focusedElementId == "folderTree")
SetFocusThreadPane();
}
@ -1014,3 +1061,12 @@ function SetFocusMessagePane()
return;
}
function is_folderpane_collapsed()
{
if (gray_vertical_splitter_exists)
{
return (gray_vertical_splitter_exists.getAttribute('state') == 'collapsed');
}
return false;
}

View File

@ -126,10 +126,10 @@ Rights Reserved.
<splitter id="sidebar-splitter" state="collapsed"/>
<box orient="vertical" flex="1">
<box align ="horizontal" flex="1">
<box align ="horizontal" persist="height" flex="1">
<tree id="folderTree" flex="1" style="width:0px;" context="folderPaneContext" />
<splitter id="gray_vertical_splitter" collapse="after" persist="state"/>
<tree id="threadTree" flex="2" style="width:0px" context="threadPaneContext" class="window-focusborder" focusring="false"/>
<splitter id="gray_vertical_splitter" collapse="before" persist="state"/>
<tree id="threadTree" flex="2" persist="width" style="width:0px" context="threadPaneContext" class="window-focusborder" focusring="false"/>
</box>
<!-- if you change this id, please change GetThreadAndMessagePaneSplitter() and MsgToggleMessagePnae() -->
<splitter id="threadpane-splitter" collapse="after" persist="state"
@ -137,7 +137,7 @@ Rights Reserved.
<grippy/>
</splitter>
<!-- msg header view -->
<box id="messagepanebox" orient="vertical" flex="4" persist="collapsed" class="window-focusborder" focusring="false">
<box id="messagepanebox" orient="vertical" flex="4" persist="collapsed height" class="window-focusborder" focusring="false">
<toolbox id="msgHeaderView"/>
<!-- message view -->

View File

@ -283,6 +283,9 @@ function OnLoadMessenger()
gHaveLoadedMessage = false;
//Set focus to the Thread Pane the first time the window is opened.
SetFocusThreadPane();
var afterLoadMessenger = new Date();
var timeToLoad = (afterLoadMessenger.getTime() - beforeLoadMessenger.getTime())/1000;
@ -290,7 +293,7 @@ function OnLoadMessenger()
{
dump("Time in OnLoadMessger is " + timeToLoad + " seconds\n");
}
}
function OnUnloadMessenger()