changeset 326:8ef75b54e3dd

make list view compatible with Sidebar Tabs extension (and perhaps other extensions that manipulate the sidebar) by hiding the snowlSidebar wrapper around sidebar-box using the hidden attribute instead of the width/height attributes
author Myk Melez <myk@mozilla.org>
date Wed, 15 Oct 2008 16:40:35 -0700
parents 3e8c77f08177
children 3a8dfaf1ac31
files content/list.js content/list.xul
diffstat 2 files changed, 3 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/content/list.js	Wed Oct 15 11:26:04 2008 -0700
+++ b/content/list.js	Wed Oct 15 16:40:35 2008 -0700
@@ -178,8 +178,8 @@
     // Listen for sidebar-box hidden attr change, to toggle properly
     sidebarBox.addEventListener("DOMAttrModified",
         function(aEvent) { 
-          if (aEvent.target.id == "sidebar-box")
-            SnowlMessageView._toggleSidebar(aEvent);
+          if (aEvent.target.id == "sidebar-box" && aEvent.attrName == "hidden")
+            SnowlMessageView._snowlSidebar.hidden = (aEvent.newValue == "true");
         }, false);
 
     // Restore previous layout view and set menuitem checked
@@ -487,31 +487,6 @@
     this._tree.boxObject.invalidate();
   },
 
-  // Functions to handle proper display of sidebar since a parent node has
-  // been added to sidebar to make the extra layouts (widemessage) possible.
-  show_snowlSidebar: function() {
-    let snowlSidebar = this._snowlSidebar;
-    snowlSidebar.height = snowlSidebar.getAttribute("heightSnowlLayouts");
-    snowlSidebar.width = snowlSidebar.getAttribute("widthSnowlLayouts");
-  },
-
-  hide_snowlSidebar: function() {
-    let snowlSidebar = this._snowlSidebar;
-    snowlSidebar.setAttribute("heightSnowlLayouts", snowlSidebar.height);
-    snowlSidebar.height = 0;
-    snowlSidebar.setAttribute("widthSnowlLayouts", snowlSidebar.width);
-    snowlSidebar.width = 0;
-  },
-
-  _toggleSidebar: function(aEvent) {
-    if (aEvent.attrName == "hidden") {
-      if (aEvent.newValue == "true")
-        this.hide_snowlSidebar();
-      else
-        this.show_snowlSidebar();
-    }
-  },
-
   onClickColumnHeader: function(aEvent) {
     let column = aEvent.target;
     let property = this._columnProperties[column.id];
--- a/content/list.xul	Wed Oct 15 11:26:04 2008 -0700
+++ b/content/list.xul	Wed Oct 15 16:40:35 2008 -0700
@@ -53,7 +53,7 @@
   <hbox id="browser">
     <hbox id="snowlSidebar"
           insertbefore="sidebar-splitter"
-          persist="heightSnowlLayouts widthSnowlLayouts"/>
+          persist="width height hidden"/>
   </hbox>
   
   <vbox id="sidebar-box"