Bug 610603 - mailnews.headers.showMessageId doesn't show the Message-ID unless you click on '+'; r=neil ui-r=clarkbw
authorrsx11m.pub@gmail.com
Fri, 19 Nov 2010 11:24:49 +0000
changeset 6725 a93fd1e3b81e1a9084922810b0e3c8bd1ae40bf5
parent 6724 1b341754e61ea5850cac47bd1c00c3a62f613bec
child 6726 c785aae4b1d19ca95392ef9bf6cf51811777ead6
push idunknown
push userunknown
push dateunknown
reviewersneil, clarkbw
bugs610603
Bug 610603 - mailnews.headers.showMessageId doesn't show the Message-ID unless you click on '+'; r=neil ui-r=clarkbw
mail/base/content/mailWidgets.xml
--- a/mail/base/content/mailWidgets.xml
+++ b/mail/base/content/mailWidgets.xml
@@ -761,21 +761,22 @@
         </body>
       </method>
 
       <!-- updateMessageIdNode: private method used to set properties on an MessageId node -->
       <method name="updateMessageIdNode">
         <parameter name="aMessageIdNode"/>
         <parameter name="aIndex"/>
         <parameter name="aMessageId"/>
+        <parameter name="aLastId"/>
         <body>
           <![CDATA[
             var showFullMessageIds = this.showFullMessageIds;
 
-            if (showFullMessageIds)
+            if (showFullMessageIds || aIndex == aLastId)
             {
               aMessageIdNode.setAttribute("label", aMessageId);
               aMessageIdNode.removeAttribute("tooltiptext");
             }
             else
             {
               aMessageIdNode.setAttribute("label", aIndex);
               aMessageIdNode.setAttribute("tooltiptext", aMessageId);
@@ -793,35 +794,39 @@
             var headerValue    = this.headerValue;
             var messageIdNodes = headerValue.childNodes;
             var numMessageIds  = this.mMessageIds.length;
             var index = 0;
 
             while (messageIdNodes.length > numMessageIds * 2 - 1)
               headerValue.removeChild(headerValue.lastChild);
 
+            this.toggleIcon.hidden = numMessageIds <= 1;
+
             for (var index = 0; index < numMessageIds; index++)
             {
               if (index * 2 <= messageIdNodes.length - 1)
               {
-                this.updateMessageIdNode(messageIdNodes[index * 2], index + 1, this.mMessageIds[index]);
+                this.updateMessageIdNode(messageIdNodes[index * 2], index + 1,
+                                         this.mMessageIds[index], numMessageIds);
               }
               else
               {
                 var newMessageIdNode = document.createElement("mail-messageid");
 
                 if (index)
                 {
                   var textNode = document.createElement("text");
                   textNode.setAttribute("value", ", ");
                   textNode.setAttribute("class", "messageIdSeparator");
                   headerValue.appendChild(textNode);
                 }
                 var itemInDocument = headerValue.appendChild(newMessageIdNode);
-                this.updateMessageIdNode(itemInDocument, index + 1, this.mMessageIds[index]);
+                this.updateMessageIdNode(itemInDocument, index + 1,
+                                         this.mMessageIds[index], numMessageIds);
               }
             }
           ]]>
         </body>
       </method>
 
       <method name="toggleWrap">
         <body>