diff --git a/mozilla/mailnews/base/resources/content/commandglue.js b/mozilla/mailnews/base/resources/content/commandglue.js index de7bbfb4727..5936e0c504a 100644 --- a/mozilla/mailnews/base/resources/content/commandglue.js +++ b/mozilla/mailnews/base/resources/content/commandglue.js @@ -651,7 +651,7 @@ function CreateDBView(msgFolder, viewType, viewFlags, sortType, sortOrder) // based on the collapsed state of the thread pane/message pane splitter, // suppress message display if appropriate. - gDBView.suppressMsgDisplay = IsThreadAndMessagePaneSplitterCollapsed(); + gDBView.suppressMsgDisplay = IsMessagePaneCollapsed(); UpdateSortIndicators(gCurSortType, sortOrder); } @@ -682,8 +682,18 @@ function GetSelectedFolderResource() return GetFolderResource(folderTree, startIndex.value); } -function NotifyChangedMessagePaneVisibility(now_hidden) +function ChangeMessagePaneVisibility(now_hidden) { + // we also have to hide the File/Attachments menuitem + node = document.getElementById("fileAttachmentMenu"); + if (node) + node.hidden = now_hidden; + + if (gDBView) { + // the collapsed state is the state after we released the mouse + // so we take it as it is + gDBView.suppressMsgDisplay = now_hidden; + } var event = document.createEvent('Events'); if (now_hidden) { event.initEvent('messagepane-hide', false, true); @@ -698,22 +708,14 @@ function OnMouseUpThreadAndMessagePaneSplitter() { // the collapsed state is the state after we released the mouse // so we take it as it is - var now_hidden = IsThreadAndMessagePaneSplitterCollapsed(); - if (gDBView) { - gDBView.suppressMsgDisplay = now_hidden; - } - NotifyChangedMessagePaneVisibility(now_hidden); + ChangeMessagePaneVisibility(IsMessagePaneCollapsed()); } function OnClickThreadAndMessagePaneSplitterGrippy() { // the collapsed state is the state when we clicked on the grippy // not when afterwards, so we need to reverse this value - var now_hidden = !IsThreadAndMessagePaneSplitterCollapsed(); - if (gDBView) { - gDBView.suppressMsgDisplay = now_hidden; - } - NotifyChangedMessagePaneVisibility(now_hidden); + ChangeMessagePaneVisibility(!IsMessagePaneCollapsed()); } function FolderPaneSelectionChange() diff --git a/mozilla/mailnews/base/resources/content/mail3PaneWindowCommands.js b/mozilla/mailnews/base/resources/content/mail3PaneWindowCommands.js index 3b5d40c09ee..6ce2d268c22 100644 --- a/mozilla/mailnews/base/resources/content/mail3PaneWindowCommands.js +++ b/mozilla/mailnews/base/resources/content/mail3PaneWindowCommands.js @@ -894,7 +894,7 @@ function IsFolderSelected() function IsMessageDisplayedInMessagePane() { - return (!IsThreadAndMessagePaneSplitterCollapsed() && (GetNumSelectedMessages() > 0)); + return (!IsMessagePaneCollapsed() && (GetNumSelectedMessages() > 0)); } function MsgDeleteFolder() @@ -1047,7 +1047,7 @@ function SwitchPaneFocus(event) searchInput.focus(); else if ((focusedElement == threadTree || focusedElement == searchInput) && !IsFolderPaneCollapsed()) folderTree.focus(); - else if (focusedElement != messagePane && !IsThreadAndMessagePaneSplitterCollapsed()) + else if (focusedElement != messagePane && !IsMessagePaneCollapsed()) SetFocusMessagePane(); else threadTree.focus(); @@ -1056,7 +1056,7 @@ function SwitchPaneFocus(event) { if (focusedElement == searchInput) threadTree.focus(); - else if (focusedElement == threadTree && !IsThreadAndMessagePaneSplitterCollapsed()) + else if (focusedElement == threadTree && !IsMessagePaneCollapsed()) SetFocusMessagePane(); else if (focusedElement != folderTree && !IsFolderPaneCollapsed()) folderTree.focus(); diff --git a/mozilla/mailnews/base/resources/content/mailWindowOverlay.js b/mozilla/mailnews/base/resources/content/mailWindowOverlay.js index b13aac8dbaa..66d3e271337 100644 --- a/mozilla/mailnews/base/resources/content/mailWindowOverlay.js +++ b/mozilla/mailnews/base/resources/content/mailWindowOverlay.js @@ -133,34 +133,9 @@ function goUpdateMailMenuItems(commandset) function file_init() { - if (!gMessengerBundle) - gMessengerBundle = document.getElementById("bundle_messenger"); - file_attachments(); -/* file_attachments() can return false to indicate a load failure, - but if you return false to oncreate then - the popup menu will not display which is not a good thing. - */ - document.commandDispatcher.updateCommands('create-menu-file'); } -function file_attachments() -{ - var numAttachments = GetNumberOfAttachmentsForDisplayedMessage(); - var amParent=document.getElementById('fileAttachmentMenu'); - if (!amParent) - return false; - - // hide the attachment menu item if the message does not have any messages.. - if (numAttachments > 0) - { - amParent.removeAttribute('hidden'); - } - else - amParent.setAttribute('hidden',true); - return true; -} - function InitEditMessagesMenu() { goSetMenuValue('cmd_delete', 'valueDefault'); @@ -183,7 +158,7 @@ function view_init() { var message_menuitem_hidden = message_menuitem.getAttribute("hidden"); if(message_menuitem_hidden != "true"){ - message_menuitem.setAttribute('checked',!IsThreadAndMessagePaneSplitterCollapsed()); + message_menuitem.setAttribute('checked', !IsMessagePaneCollapsed()); } } diff --git a/mozilla/mailnews/base/resources/content/mailWindowOverlay.xul b/mozilla/mailnews/base/resources/content/mailWindowOverlay.xul index de8a5b31c24..2240ed1a2b5 100644 --- a/mozilla/mailnews/base/resources/content/mailWindowOverlay.xul +++ b/mozilla/mailnews/base/resources/content/mailWindowOverlay.xul @@ -1049,7 +1049,7 @@ key="key_openFileMessage" accesskey="&openMessageFileCmd.accesskey;" oncommand="MsgOpenFromFile();"/> - + diff --git a/mozilla/mailnews/base/resources/content/msgHdrViewOverlay.js b/mozilla/mailnews/base/resources/content/msgHdrViewOverlay.js index 9bd6d09d988..9e7bf9623b8 100644 --- a/mozilla/mailnews/base/resources/content/msgHdrViewOverlay.js +++ b/mozilla/mailnews/base/resources/content/msgHdrViewOverlay.js @@ -381,6 +381,11 @@ var messageHeaderSink = { // we only need to do this on the first attachment var numAttachments = currentAttachments.length; if (numAttachments == 1) { + // we also have to enable the File/Attachments menuitem + var node = document.getElementById("fileAttachmentMenu"); + if (node) + node.removeAttribute("disabled"); + try { // convert the uri into a hdr var hdr = messenger.messageServiceFromURI(uri).messageURIToMsgHdr(uri); @@ -667,6 +672,11 @@ function HideMessageHeaderPane() node = document.getElementById("expandedHeaderView"); if (node) node.collapsed = true; + + // we also have to disable the File/Attachments menuitem + node = document.getElementById("fileAttachmentMenu"); + if (node) + node.setAttribute("disabled", "true"); } function OutputNewsgroups(headerEntry, headerValue) @@ -1116,6 +1126,11 @@ function SaveAllAttachments() function ClearAttachmentList() { + // we also have to disable the File/Attachments menuitem + node = document.getElementById("fileAttachmentMenu"); + if (node) + node.setAttribute("disabled", "true"); + // clear selection var list = document.getElementById('attachmentList'); list.clearSelection(); diff --git a/mozilla/mailnews/base/resources/content/msgMail3PaneWindow.js b/mozilla/mailnews/base/resources/content/msgMail3PaneWindow.js index 036c96bcc8a..72e0d3924a4 100644 --- a/mozilla/mailnews/base/resources/content/msgMail3PaneWindow.js +++ b/mozilla/mailnews/base/resources/content/msgMail3PaneWindow.js @@ -1039,7 +1039,7 @@ function GetTotalCountElement() return totalCount; } -function IsThreadAndMessagePaneSplitterCollapsed() +function IsMessagePaneCollapsed() { var messagePane = GetMessagePane(); try {