Bug 509412 - tab close buttons disappear when closing the first tab. r=dao
authorBill Gianopoulos <bill@wg9s.com>
Sun, 16 Aug 2009 02:34:20 +0200
changeset 31576 59d62d5e33c7405a9e1f2d73eacdff2aa3b3f7f6
parent 31575 63517774148098f925d42843ae6dae1ff333d339
child 31577 6de448deb9551790c8405463cee73ffb9260ded5
push id94
push userdgottwald@mozilla.com
push dateWed, 09 Sep 2009 08:43:59 +0000
reviewersdao
bugs509412
milestone1.9.2a2pre
Bug 509412 - tab close buttons disappear when closing the first tab. r=dao
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -1485,17 +1485,16 @@
             if (aCloseWindow) {
               this._windowIsClosing = true;
               while (this._removingTabs.length)
                 this._endRemoveTab([this._removingTabs[0], false]);
             } else if (!this._windowIsClosing) {
               if (aNewTab && gURLBar)
                 gURLBar.focus();
 
-              this.tabContainer.adjustTabstrip();
               // workaround for bug 345399
               this.tabContainer.mTabstrip._updateScrollButtonsDisabledState();
             }
 
             // We're going to remove the tab and the browser now.
             // Clean up mTabFilters and mTabListeners now rather than in
             // _beginRemoveTab, so that their size is always in sync with the
             // number of tabs and browsers (the xbl destructor depends on this).
@@ -1523,16 +1522,20 @@
 
             // Remove the tab ...
             this.tabContainer.removeChild(aTab);
 
             // ... and fix up the _tPos properties immediately.
             for (let i = aTab._tPos; i < this.mTabs.length; i++)
               this.mTabs[i]._tPos = i;
 
+            // update tab close buttons state
+            if (!this._windowIsClosing)
+              this.tabContainer.adjustTabstrip();
+
             // update first-tab/last-tab/beforeselected/afterselected attributes
             this.selectedTab._selected = true;
 
             // This will unload the document. An unload handler could remove
             // dependant tabs, so it's important that the tabbrowser is now in
             // a consistent state (tab removed, tab positions updated, etc.).
             // Also, it's important that another tab has been selected before
             // the panel is removed; otherwise, a random sibling panel can flash.