diff --git a/mail/base/content/mailWindowOverlay.js b/mail/base/content/mailWindowOverlay.js index 130227a141..4f35588a93 100644 --- a/mail/base/content/mailWindowOverlay.js +++ b/mail/base/content/mailWindowOverlay.js @@ -1758,6 +1758,17 @@ function MsgJunk() JunkSelectedMessages(!SelectedMessagesAreJunk()); } + +function UpdateJunkButton() +{ + var hdr = gDBView.hdrForFirstSelectedMessage; + var junkScore = hdr.getStringProperty("junkscore"); + var isJunk = ((junkScore != "") && (junkScore != "0")); + if (isNewsURI(hdr.folder.URI)) + isJunk = true; + document.getElementById('junkButton').disabled = isJunk; +} + function MsgMarkMsgAsRead(markRead) { if (!markRead) { diff --git a/mail/base/content/msgHdrViewOverlay.js b/mail/base/content/msgHdrViewOverlay.js index d460359320..3f29ee1249 100644 --- a/mail/base/content/msgHdrViewOverlay.js +++ b/mail/base/content/msgHdrViewOverlay.js @@ -23,6 +23,7 @@ # Contributor(s): # Markus Hossner # Mark Banner +# David Ascher # # Alternatively, the contents of this file may be used under the terms of # either the GNU General Public License Version 2 or later (the "GPL"), or @@ -263,6 +264,14 @@ function OnLoadMsgHeaderPane() var deckHeaderView = document.getElementById("msgHeaderViewDeck"); gCollapsedHeaderViewMode = deckHeaderView.selectedIndex == 0; + + // work around XUL deck bug where collapsed header view, if it's the persisted + // default, wouldn't be sized properly because of the larger expanded + // view "stretches" the deck. + if (gCollapsedHeaderViewMode) + document.getElementById('expandedHeaderView').collapsed = true; + else + document.getElementById('collapsedHeaderView').collapsed = true; // dispatch an event letting any listeners know that we have loaded the message pane var event = document.createEvent('Events'); @@ -394,6 +403,7 @@ var messageHeaderSink = { ShowMessageHeaderPane(); UpdateMessageHeaders(); ShowEditMessageBox(); + UpdateJunkButton(); for (index in gMessageListeners) gMessageListeners[index].onEndHeaders(); @@ -785,7 +795,11 @@ function updateHeaderValue(headerEntry, headerValue) function updateHeaderValueInTextNode(headerEntry, headerValue) { - headerEntry.textNode.value = headerValue; + try { + headerEntry.textNode.value = headerValue; + } catch (e) { + dump("headerEntry = " + headerEntry + " and headerValue = " + headerValue + '\n') + } } function createNewHeaderView(headerName, label) @@ -795,6 +809,7 @@ function createNewHeaderView(headerName, label) newHeader.setAttribute('id', idName); newHeader.setAttribute('label', label); + newHeader.setAttribute('flex', '1'); newHeader.collapsed = true; // this new element needs to be inserted into the view... diff --git a/mail/base/content/msgHdrViewOverlay.xul b/mail/base/content/msgHdrViewOverlay.xul index 574859d561..a291f75300 100644 --- a/mail/base/content/msgHdrViewOverlay.xul +++ b/mail/base/content/msgHdrViewOverlay.xul @@ -102,41 +102,38 @@ - - - - - - - - - - - - - - - - - - + + + + + label="&fromField2.label;"/> - - - - + + + + - - - + + + + + + + + +