From ac40b90f6b8002efdd03dca71f5b68ed6735351e Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Tue, 1 May 2001 03:05:02 +0000 Subject: [PATCH] fix for #77506. r=varada, sr=bienvenu prevent the bad state where we are supressing message display, but the message pane is not hidden. --- .../base/resources/content/commandglue.js | 36 +++++++------------ .../content/mail3PaneWindowVertLayout.xul | 3 +- mailnews/base/resources/content/messenger.xul | 3 +- .../resources/content/msgMail3PaneWindow.js | 12 +++---- 4 files changed, 22 insertions(+), 32 deletions(-) diff --git a/mailnews/base/resources/content/commandglue.js b/mailnews/base/resources/content/commandglue.js index 6b77639c60f..75e76c0651e 100644 --- a/mailnews/base/resources/content/commandglue.js +++ b/mailnews/base/resources/content/commandglue.js @@ -583,11 +583,7 @@ function CreateDBView(msgFolder, viewType, viewFlags, sortType, sortOrder) // based on the collapsed state of the thread pane/message pane splitter, // supress message display if appropriate. - var collapsed = IsThreadAndMessagePaneSplitterCollapsed(); - if (collapsed) - gDBView.supressMsgDisplay = true; - else - gDBView.supressMsgDisplay = false; + gDBView.supressMsgDisplay = IsThreadAndMessagePaneSplitterCollapsed(); UpdateSortIndicators(gCurSortType, sortOrder); PersistViewAttributesOnFolder(); @@ -680,30 +676,22 @@ function GetSelectedFolderResource() return folderResource; } -//Called when the splitter in between the thread and message panes is clicked. -function OnClickThreadAndMessagePaneSplitter() -{ - var collapsed = IsThreadAndMessagePaneSplitterCollapsed(); - // collapsed is the previous state, so we must be expanding - // the splitter if collapsed is true - if (gDBView) +function OnMouseUpThreadAndMessagePaneSplitter() { - if (!collapsed) - gDBView.supressMsgDisplay = true; - else - gDBView.supressMsgDisplay = false; + if (gDBView) { + // the collapsed state is the state after we released the mouse + // so we take it as it is + gDBView.supressMsgDisplay = IsThreadAndMessagePaneSplitterCollapsed(); + } } -/* - dump("We are in OnClickThreadAndMessagePaneSplitter()\n"); - var collapsed = IsThreadAndMessagePaneSplitterCollapsed(); - //collapsed is the previous state so we know we are opening. - if(collapsed) +function OnClickThreadAndMessagePaneSplitterGrippy() { - LoadSelectionIntoMessagePane(); - setTimeout("ScrollToMessage(new,true,true);",0); + if (gDBView) { + // the collapsed state is the state when we clicked on the grippy + // not when afterwards, so we need to reverse this value + gDBView.supressMsgDisplay = !IsThreadAndMessagePaneSplitterCollapsed(); } -*/ } function FolderPaneSelectionChange() diff --git a/mailnews/base/resources/content/mail3PaneWindowVertLayout.xul b/mailnews/base/resources/content/mail3PaneWindowVertLayout.xul index a4692f07cde..1a1a4b1c89e 100644 --- a/mailnews/base/resources/content/mail3PaneWindowVertLayout.xul +++ b/mailnews/base/resources/content/mail3PaneWindowVertLayout.xul @@ -152,8 +152,9 @@ Rights Reserved. - + diff --git a/mailnews/base/resources/content/messenger.xul b/mailnews/base/resources/content/messenger.xul index 3c11472d355..18b56fa573d 100644 --- a/mailnews/base/resources/content/messenger.xul +++ b/mailnews/base/resources/content/messenger.xul @@ -154,8 +154,9 @@ Rights Reserved. - + diff --git a/mailnews/base/resources/content/msgMail3PaneWindow.js b/mailnews/base/resources/content/msgMail3PaneWindow.js index 51c1421eb4b..b0ed84f5574 100644 --- a/mailnews/base/resources/content/msgMail3PaneWindow.js +++ b/mailnews/base/resources/content/msgMail3PaneWindow.js @@ -642,16 +642,16 @@ function GetTotalCountElement() gTotalCount = totalCount; return totalCount; } + function IsThreadAndMessagePaneSplitterCollapsed() { - var splitter = GetThreadAndMessagePaneSplitter(); - if(splitter) - { - var state = splitter.getAttribute('state'); - return (state == "collapsed"); + var messagePane = GetMessagePane(); + try { + return (messagePane.getAttribute("collapsed") == "true"); } - else + catch (ex) { return false; + } } function FindMessenger()