diff --git a/mozilla/browser/app/profile/firefox.js b/mozilla/browser/app/profile/firefox.js index b05f25878cb..44c4ba56c61 100644 --- a/mozilla/browser/app/profile/firefox.js +++ b/mozilla/browser/app/profile/firefox.js @@ -305,7 +305,6 @@ pref("browser.tabs.loadBookmarksInBackground", false); pref("browser.tabs.tabMinWidth", 100); pref("browser.tabs.tabMaxWidth", 250); pref("browser.tabs.tabClipWidth", 140); -pref("browser.tabs.closingAnimation", true); // Where to show tab close buttons: // 0 on active tab only diff --git a/mozilla/browser/base/content/tabbrowser.xml b/mozilla/browser/base/content/tabbrowser.xml index 7dd9d5a2d7e..0ea599456f0 100644 --- a/mozilla/browser/base/content/tabbrowser.xml +++ b/mozilla/browser/base/content/tabbrowser.xml @@ -30,7 +30,6 @@ - Simon Bünzli - Michael Ventnor - Mark Pilgrim - - Dão Gottwald - - Alternatively, the contents of this file may be used under the terms of - either the GNU General Public License Version 2 or later (the "GPL"), or @@ -109,7 +108,7 @@ + tabbrowser.removeTab(tabbrowser.mContextTab);"/> @@ -1355,7 +1354,7 @@ for (var i = childNodes.length - 1; i >= 0; --i) { if (childNodes[i] != aTab) - this.removeTab(childNodes[i], true); + this.removeTab(childNodes[i]); } } ]]> @@ -1365,7 +1364,7 @@ @@ -1386,34 +1385,36 @@ - -1) - return; - } else { - this._removingTabs = []; + // see notes in addTab + var _delayedUpdate = function(aTabContainer) { + aTabContainer.adjustTabstrip(); + aTabContainer.mTabstrip._updateScrollButtonsDisabledState(); } + setTimeout(_delayedUpdate, 0, this.mTabContainer); - var l = this.mTabContainer.childNodes.length - this._removingTabs.length; if (l == 1) { - if (this.mPrefs.getBoolPref("browser.tabs.autoHide")) { - // hide the tab bar - this.mPrefs.setBoolPref("browser.tabs.forceHide", true); - this.setStripVisibilityTo(false); - return; - } // add a new blank tab to replace the one we're about to close // (this ensures that the remaining tab is as good as new) this.addTab("about:blank"); + l++; } else if (l == 2) { var autohide = this.mPrefs.getBoolPref("browser.tabs.autoHide"); @@ -1422,69 +1423,6 @@ this.setStripVisibilityTo(false); } - if (l == 1 || - !aUseAnimation || - this._removingTabs.length > 2 || - !this.mPrefs.getBoolPref("browser.tabs.closingAnimation")) { - this._destroyTab(aTab); - return; - } - - this._removingTabs.push(aTab); - this._blurTab(aTab); - - aTab.width = aTab.boxObject.width; - aTab.minWidth = ""; - aTab.flex = ""; - - function processFrame(tab, tabbrowser, animation) { - if (animation.opacities.length) { - tab.style.setProperty("opacity", animation.opacity * animation.opacities.shift(), "important"); - tab.width = animation.width * animation.widths.shift(); - tabbrowser._fillTrailingGap(); - } else { - clearInterval(animation.id); - tabbrowser._removingTabs.splice(tabbrowser._removingTabs.indexOf(tab), 1); - tabbrowser._destroyTab(tab); - } - } - - var animation = { - opacity: parseFloat(document.defaultView.getComputedStyle(aTab, null).opacity), - width: aTab.width, - opacities: [.5, .25], - widths: [.85, .6] - }; - animation.id = setInterval(processFrame, 40, aTab, this, animation); - processFrame(aTab, this, animation); - ]]> - - - - - - - - - - - - - - = + scrolledSize.value) { + tabStrip.scrollByPixels(-1 * this.mTabContainer.firstChild + .boxObject.width); + } + } + catch (ex) { + } + + // Find the tab to select + var newIndex = -1; + if (currentIndex > index) + newIndex = currentIndex-1; + else if (currentIndex < index) + newIndex = currentIndex; + else { + if ("owner" in oldTab && oldTab.owner && + this.mPrefs.getBoolPref("browser.tabs.selectOwnerOnClose")) { + for (i = 0; i < this.mTabContainer.childNodes.length; ++i) { + tab = this.mTabContainer.childNodes[i]; + if (tab == oldTab.owner) { + newIndex = i; + break; + } + } + } + if (newIndex == -1) + newIndex = (index == l - 1) ? index - 1 : index; + } + + // Select the new tab + this.selectedTab = this.mTabContainer.childNodes[newIndex]; + + for (i = oldTab._tPos; i < this.mTabContainer.childNodes.length; i++) { this.mTabContainer.childNodes[i]._tPos = i; - + } this.mTabBox.selectedPanel = this.getBrowserForTab(this.mCurrentTab).parentNode; + this.mCurrentTab._selected = true; + this.updateCurrentBrowser(); - // see comment about destroy above + // see comment above destroy above oldBrowser.focusedWindow = null; oldBrowser.focusedElement = null; ]]> - - = - scrolledSize.value) { - tabStrip.scrollByPixels(-1); - } - } catch (e) {} - ]]> - - - + null @@ -2797,7 +2769,7 @@ ]]> - +