Bug 688800 - Don't show curvy tab button and sidebar at the same time while dragging [r=mfinkle]
authorMatt Brubeck <mbrubeck@mozilla.com>
Fri, 23 Sep 2011 11:07:58 -0700
changeset 77429 27ea88e0c870fb16eb75725aeeb8819bbca7d49c
parent 77428 b1f9800647c7446ce832bfbadf54c87e5e3c75ca
child 77430 878c2c7f81599ed660b76f28c56a273a7c318af7
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersmfinkle
bugs688800
milestone9.0a1
Bug 688800 - Don't show curvy tab button and sidebar at the same time while dragging [r=mfinkle]
mobile/chrome/content/browser.js
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -1289,43 +1289,42 @@ var Browser = {
 
     let ltr = (Util.localeDir == Util.LOCALE_DIR_LTR);
 
     if (TabsPopup.visible) {
       this._setSidebarOffset(ltr ? 0 : ViewableAreaObserver.sidebarWidth);
       this._slideMultiplier = 3;
     } else {
       // If the tab bar is hidden, un-collapse it but scroll it offscreen.
-      document.getElementById("tabs-sidebar").style.visibility = "visible";
+      TabsPopup.show();
       this._setSidebarOffset(ltr ? ViewableAreaObserver.sidebarWidth : 0);
       this._slideMultiplier = 6;
     }
   },
 
   /** Move the tablet sidebar by aX pixels. */
   slideSidebarBy: function slideSidebarBy(aX) {
     this._setSidebarOffset(this._sidebarOffset + (aX * this._slideMultiplier));
   },
 
   /** Call this when tablet sidebar dragging is finished. */
   ungrabSidebar: function ungrabSidebar() {
     if (!this._grabbedSidebar)
       return;
-
     this._grabbedSidebar = false;
-    document.getElementById("tabs-sidebar").style.visibility = "";
 
     let finalOffset = this._sidebarOffset;
     this._setSidebarOffset(0);
 
     let rtl = (Util.localeDir == Util.LOCALE_DIR_RTL);
     if (finalOffset > (ViewableAreaObserver.sidebarWidth / 2) ^ rtl)
       TabsPopup.hide();
     else
-      TabsPopup.show();
+      // we already called TabsPopup.show() in grabSidebar; just need to update the width again.
+      ViewableAreaObserver.update();
   },
 
   /** Move the tablet sidebar. */
   _setSidebarOffset: function _setSidebarOffset(aOffset) {
     this._sidebarOffset = aOffset;
     let scrollX = Util.clamp(aOffset, 0, ViewableAreaObserver.sidebarWidth);
     Browser.controlsScrollboxScroller.scrollTo(scrollX, 0);
   }