# HG changeset patch # User Ian Neal # Date 1629577916 -3600 # Parent 023c47cbf6ad7a90d23993ee8492aa5e8eb04f88 Bug 1726006 - In MailNews, opening a Calendar tab closes the Message Pane in the Mail tab. r=frg a=frg diff --git a/suite/mailnews/content/tabmail.js b/suite/mailnews/content/tabmail.js --- a/suite/mailnews/content/tabmail.js +++ b/suite/mailnews/content/tabmail.js @@ -207,46 +207,57 @@ var gMailNewsTabsType = // reroot the message sink (we might have switched layout) messenger.setWindow(null, null); messenger.setWindow(window, msgWindow); // Clear thread pane selection - otherwise, the tree tries to impose the // the current selection on the new view. let msgHdr = aTabInfo.hdr; let msgId = aTabInfo.selectedMsgId; + aTabInfo.hdr = null; + aTabInfo.selectedMsgId = null; + aTabInfo.dbView = null; let folder = MailUtils.getFolderForURI(aTabInfo.uriToOpen); gFolderTreeView.selectFolder(folder); gCurrentFolderToReroot = null; delete aTabInfo.uriToOpen; // destroy after use! + // Store the folder that is being opened. + aTabInfo.msgSelectedFolder = folder; + // restore our message data aTabInfo.hdr = msgHdr; aTabInfo.selectedMsgId = msgId; aTabInfo.dbView = gDBView; UpdateMailToolbar("new tab"); } - // restore layout if present - ShowThreadPane(); - // Some modes (e.g. new message tabs) need to initially hide the splitters, - // this is marked by aTabInfo.clearSplitter=true. - let clearSplitter = "clearSplitter" in aTabInfo && aTabInfo.clearSplitter; - if (clearSplitter) - { - aTabInfo.messageSplitter.collapsible = true; - aTabInfo.folderSplitter.collapsible = true; - delete aTabInfo.clearSplitter; + // Do not bother with Thread and Message panes if at server level. + if (!aTabInfo.msgSelectedFolder.isServer) { + // Restore the layout if present. + ShowThreadPane(); + // Some modes (e.g. new message tabs) need to initially hide the + // splitters, this is marked by aTabInfo.clearSplitter=true. + let clearSplitter = "clearSplitter" in aTabInfo && aTabInfo.clearSplitter; + if (clearSplitter) { + aTabInfo.messageSplitter.collapsible = true; + aTabInfo.folderSplitter.collapsible = true; + delete aTabInfo.clearSplitter; + } + SetSplitterState(GetThreadAndMessagePaneSplitter(), + aTabInfo.messageSplitter); + SetSplitterState(GetFolderPaneSplitter(), + aTabInfo.folderSplitter); + this._updatePaneLayout(aTabInfo); + ClearMessagePane(); + // Force the header pane twisty state restoration by toggling from the + // opposite. + if (gCollapsedHeaderViewMode != aTabInfo.headerViewMode) + ToggleHeaderView(); } - SetSplitterState(GetThreadAndMessagePaneSplitter(), aTabInfo.messageSplitter); - SetSplitterState(GetFolderPaneSplitter(), aTabInfo.folderSplitter); - this._updatePaneLayout(aTabInfo); - ClearMessagePane(); - // force header pane twisty state restoration by toggling from the opposite - if (gCollapsedHeaderViewMode != aTabInfo.headerViewMode) - ToggleHeaderView(); // restore globals messenger = aTabInfo.messenger; gDBView = aTabInfo.dbView; gSearchSession = aTabInfo.searchSession; let folderToSelect = aTabInfo.msgSelectedFolder || gDBView && gDBView.msgFolder; // restore view state if we had one