Bug 509701 Fix fallout from bug 506492 r=IanN
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Tue, 01 Sep 2009 22:32:41 +0100
changeset 3485 42bada3ecb39ffb4ccea7142b889fe625e7f5ac6
parent 3484 c98edd97fb3fd24ce6996cb704006ccf7c1ba8f2
child 3486 7cd1d18a9c4671fb2c7b2650d13173f90d1a222a
push idunknown
push userunknown
push dateunknown
reviewersIanN
bugs509701, 506492
Bug 509701 Fix fallout from bug 506492 r=IanN
suite/mailnews/mailWidgets.xml
suite/mailnews/mailWindowOverlay.xul
suite/mailnews/msgMail3PaneWindow.js
--- a/suite/mailnews/mailWidgets.xml
+++ b/suite/mailnews/mailWidgets.xml
@@ -1682,18 +1682,17 @@
           })
         ]]>
       </field>
       <method name="setInitialSelection">
         <body>
           <![CDATA[
             var view = this.tree.view;
 
-            if (!view.selection.currentColumn)
-              view.selection.currentColumn = this.tree.columns.getFirstColumn();
+            view.selection.currentColumn = this.tree.columns.getFirstColumn();
 
             view.selection.selectEventsSuppressed = true;
             for (var i = 0; i < view.rowCount; i++) {
               if (view.isContainer(i)) {
                 if (view.isContainerEmpty(i) == view.isContainerOpen(i))
                   view.toggleOpenState(i);
                 if (view.isContainerOpen(i)) {
                   if (i + 1 == view.rowCount ||
--- a/suite/mailnews/mailWindowOverlay.xul
+++ b/suite/mailnews/mailWindowOverlay.xul
@@ -1155,17 +1155,17 @@
                     checked="true"
                     label="&showMessengerToolbarCmd.label;"
                     accesskey="&showMessengerToolbarCmd.accesskey;"
                     oncommand="goToggleToolbar('msgToolbar', 'menu_showMessengerToolbar')"/>
           <menuitem id="menu_showLocationToolbar"
                     type="checkbox"
                     label="&showLocationToolbarCmd.label;"
                     accesskey="&showLocationToolbarCmd.accesskey;"
-                    oncommand="goToggleLocationToolbar('true');"
+                    oncommand="goToggleToolbar('msgLocationToolbar', 'menu_showLocationToolbar');"
                     observes="mailHideMenus"
                     checked="false" persist="checked"/>
           <menuitem id="menu_showSearchToolbar"
                     type="checkbox"
                     checked="true"
                     label="&showSearchToolbarCmd.label;"
                     accesskey="&showSearchToolbarCmd.accesskey;"
                     oncommand="goToggleToolbar('searchBox', 'menu_showSearchToolbar'); SearchBarToggled();"
@@ -2289,18 +2289,18 @@
                 oncommand="goClickThrobber('messenger.throbber.url')"
                 tooltiptext="&throbber.tooltip;"/>
     </toolbaritem>
   </toolbarpalette>
 
 </toolbox>
 
 <toolbar id="msgLocationToolbar"
-         persist="collapsed"
-         collapsed="true"
+         persist="hidden"
+         hidden="true"
          grippytooltiptext="&locationToolbar.tooltip;"
          nowindowdrag="true">
   <hbox align="center" context="folderPaneContext">
     <image id="locationIcon" class="folderMenuItem"/>
     <menulist id="locationFolders" class="folderMenuItem"
               label=" " crop="center">
       <menupopup id="locationPopup" height="400"
                  oncommand="OnLocationTreeSelect(this);"/>
--- a/suite/mailnews/msgMail3PaneWindow.js
+++ b/suite/mailnews/msgMail3PaneWindow.js
@@ -1035,22 +1035,21 @@ function UpdateAttachmentCol(aFirstTimeF
   if (aFirstTimeFlag)
     attachmentCol.addEventListener("DOMAttrModified", OnAttachmentColAttrModified, false);
   else
     threadTree.treeBoxObject.clearStyleAndImageCaches();
 }
 
 function OnLocationToolbarAttrModified(event)
 {
-    if (!/collapsed/.test(event.attrName))
+    if (!/collapsed|hidden/.test(event.attrName))
         return;
     var searchBox = document.getElementById("searchBox");
     var desiredParent = document.getElementById("msgLocationToolbar");
-    if (desiredParent.getAttribute("collapsed") == "true" ||
-        desiredParent.getAttribute("moz-collapsed") == "true")
+    if (desiredParent.hidden || desiredParent.collapsed)
         desiredParent = document.getElementById("searchBoxHolder");
     if (searchBox.parentNode != desiredParent)
         desiredParent.appendChild(searchBox);
 }
 
 function OnLoadLocationTree()
 {
     var locationTree = document.getElementById('locationPopup').tree;
@@ -1090,26 +1089,16 @@ function UpdateLocationBar(resource)
         var name = names[i];
         var value = GetFolderAttribute(tree, resource, name);
         folders.setAttribute(name, value);
         icon.setAttribute(name, value);
     }
     folders.setAttribute('uri', resource.Value);
 }
 
-function goToggleLocationToolbar(toggle)
-{
-    // XXX hidden doesn't work, use collapsed instead
-    var menu = document.getElementById("menu_showLocationToolbar");
-    var toolbar = document.getElementById("msgLocationToolbar");
-    var checked = toolbar.collapsed;
-    menu.setAttribute('checked', checked);
-    toolbar.setAttribute('collapsed', !checked);
-}
-
 function GetFolderDatasource()
 {
   return GetFolderTree().database;
 }
 
 /* Functions for accessing particular parts of the window*/
 function GetFolderTree()
 {