Bug 626385 - Don't reposition pinned tabs when closing regular tabs. r+a=dolske
authorDão Gottwald <dao@mozilla.com>
Tue, 18 Jan 2011 09:47:48 +0100
changeset 60754 b792669a92189d390b690fd67145803185834c26
parent 60753 3db327eb5f5b15bd1f520c12fe6f4342da71d13f
child 60755 8c57ddbf4ae23f97721a6e8e490e1c5011d39002
push idunknown
push userunknown
push dateunknown
bugs626385
milestone2.0b10pre
Bug 626385 - Don't reposition pinned tabs when closing regular tabs. r+a=dolske
browser/base/content/tabbrowser.xml
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -1621,29 +1621,32 @@
             // cleanup ourselves.
             // This has to happen before we remove the child so that the
             // XBL implementation of nsIObserver still works.
             browser.destroy();
 
             if (browser == this.mCurrentBrowser)
               this.mCurrentBrowser = null;
 
+            var wasPinned = aTab.pinned;
+
             // Invalidate browsers cache, as the tab is removed from the
             // tab container.
             this._browsers = null;
 
             // Remove the tab ...
             this.tabContainer.removeChild(aTab);
 
             // ... and fix up the _tPos properties immediately.
             for (let i = aTab._tPos; i < this.tabs.length; i++)
               this.tabs[i]._tPos = i;
 
             if (!this._windowIsClosing) {
-              this.tabContainer._positionPinnedTabs();
+              if (wasPinned)
+                this.tabContainer._positionPinnedTabs();
 
               // update tab close buttons state
               this.tabContainer.adjustTabstrip();
             }
 
             // update first-tab/last-tab/beforeselected/afterselected attributes
             this.selectedTab._selected = true;