Bug 690816 - When Fennec starts, remember whether the tablet tabs sidebar was open or closed [r=lucasr]
authorMatt Brubeck <mbrubeck@mozilla.com>
Mon, 03 Oct 2011 12:40:08 -0700
changeset 78008 290504bc966998a9bec55e52b88f0995ef99712b
parent 78007 f6ca223342090ec327966af13823bd47181006e7
child 78009 2c0eb6a0e6e720cb3052cf37ddb3d3602c639b97
push id21260
push usermbrubeck@mozilla.com
push dateMon, 03 Oct 2011 23:22:50 +0000
treeherdermozilla-central@25b8388347af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr
bugs690816
milestone10.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 690816 - When Fennec starts, remember whether the tablet tabs sidebar was open or closed [r=lucasr]
mobile/chrome/content/TabletSidebar.js
mobile/chrome/content/browser.xul
mobile/themes/core/tablet.css
--- a/mobile/chrome/content/TabletSidebar.js
+++ b/mobile/chrome/content/TabletSidebar.js
@@ -37,33 +37,33 @@
 
 
 var TabletSidebar = {
   _grabbed: false, // true while the user is dragging the sidebar
   _offset: 0, // tracks how far the sidebar has been dragged
   _slideMultiplier: 1, // set greater than 1 to amplify sidebar drags (makes swiping easier)
 
   get visible() {
-    return Elements.urlbarState.hasAttribute("tablet_sidebar");
+    return Elements.urlbarState.getAttribute("tablet_sidebar") == "true";
   },
 
   toggle: function toggle() {
     if (this.visible)
       this.hide();
     else
       this.show();
   },
 
   show: function show() {
     Elements.urlbarState.setAttribute("tablet_sidebar", "true");
     ViewableAreaObserver.update();
   },
 
   hide: function hide() {
-    Elements.urlbarState.removeAttribute("tablet_sidebar");
+    Elements.urlbarState.setAttribute("tablet_sidebar", "false");
     ViewableAreaObserver.update();
   },
 
   /**
    * Call this function in landscape tablet mode to begin dragging the tab sidebar.
    * Hiding the sidebar makes the viewable area grow; showing the sidebar makes it shrink.
    */
   grab: function grab() {
--- a/mobile/chrome/content/browser.xul
+++ b/mobile/chrome/content/browser.xul
@@ -79,17 +79,17 @@
   <script type="application/javascript" src="chrome://browser/content/browser.js"/>
   <script type="application/javascript" src="chrome://browser/content/browser-ui.js"/>
   <script type="application/javascript" src="chrome://browser/content/browser-scripts.js"/>
   <script type="application/javascript" src="chrome://browser/content/Util.js"/>
   <script type="application/javascript" src="chrome://browser/content/input.js"/>
 
   <broadcasterset id="broadcasterset">
     <broadcaster id="bcast_contentShowing" disabled="false"/>
-    <broadcaster id="bcast_urlbarState" mode="view" tablet_sidebar="true"/>
+    <broadcaster id="bcast_urlbarState" mode="view" tablet_sidebar="true" persist="tablet_sidebar"/>
     <broadcaster id="bcast_uidiscovery"/>
   </broadcasterset>
 
   <observerset id="observerset">
     <observes id="observe_contentShowing" element="bcast_contentShowing" attribute="disabled" onbroadcast="BrowserUI.updateUIFocus();"/>
   </observerset>
 
   <commandset id="mainCommandSet">
--- a/mobile/themes/core/tablet.css
+++ b/mobile/themes/core/tablet.css
@@ -11,17 +11,17 @@
 .button-actionbar:hover:active {
   background-color: #8db8d8;
 }
 %endif
 
 #toolbar-main[tablet] > .button-actionbar {
   visibility: visible;
 }
-#toolbar-main[tablet][tablet_sidebar] > #tool-tabs {
+#toolbar-main[tablet][tablet_sidebar="true"] > #tool-tabs {
   visibility: collapse;
 }
 
 #controls-scrollbox[tablet] > #controls-sidebar {
   visibility: collapse;
 }
 
 #tabs-spacer[tablet]  {
@@ -127,32 +127,32 @@ documenttab[selected="true"] > vbox > st
 
 #newtab-button[tablet] > .toolbarbutton-text {
   -moz-padding-start: 0.5em;
   color: white;
   display: -moz-initial;
   text-align: start;
 }
 
-#controls-scrollbox[tablet]:not([tablet_sidebar]) > #tabs-sidebar {
+#controls-scrollbox[tablet][tablet_sidebar="false"] > #tabs-sidebar {
   visibility: collapse;
 }
 
 @media (@orientation@: portrait) {
-  #toolbar-main[tablet][tablet_sidebar] > #tool-tabs {
+  #toolbar-main[tablet][tablet_sidebar="true"] > #tool-tabs {
     visibility: visible;
   }
 
   #controls-scrollbox[tablet] > #tabs-sidebar {
     visibility: collapse;
   }
 }
 
 @media (@orientation@: landscape) {
-  #toolbar-main[tablet][tablet_sidebar] {
+  #toolbar-main[tablet][tablet_sidebar="true"] {
     -moz-padding-start: @padding_xxnormal@;
   }
 }
 
 #identity-container[tablet] #identity-popup-container {
   -moz-stack-sizing: ignore;
   max-width: @identity_popup_tablet_width@;
   min-width: @identity_popup_tablet_width@;