From 6a36de14c25cb1f11d295634690c1db05336369d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Thu, 5 Aug 2010 22:18:17 +0200 Subject: [PATCH] Bug 579869 - Skip the tab opening animation if the new tab has been pinned. r=gavin --HG-- extra : rebase_source : 4406ddd65a67e9c65705f65172afe6af1ded1c17 --- browser/base/content/browser.css | 8 ++++---- browser/base/content/tabbrowser.xml | 8 +++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/browser/base/content/browser.css b/browser/base/content/browser.css index c6416318674..267e1aaab6f 100644 --- a/browser/base/content/browser.css +++ b/browser/base/content/browser.css @@ -31,7 +31,7 @@ tabbrowser { width: 0; } -.tabbrowser-tab:not([fadein]) { +.tabbrowser-tab:not([pinned]):not([fadein]) { max-width: 1px; min-width: 1px; } @@ -40,9 +40,9 @@ tabbrowser { -moz-transition: min-width .2s ease-out, max-width .25s ease-out; } -.tabbrowser-tab:not([fadein]) > .tab-text, -.tabbrowser-tab:not([fadein]) > .tab-icon-image, -.tabbrowser-tab:not([fadein]) > .tab-close-button { +.tabbrowser-tab:not([fadein]):not([pinned]) > .tab-text, +.tabbrowser-tab:not([fadein]):not([pinned]) > .tab-icon-image, +.tabbrowser-tab:not([fadein]):not([pinned]) > .tab-close-button { opacity: 0 !important; } diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index a8b5c13908e..ab6911c5977 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -187,6 +187,7 @@ return; this.moveTabTo(aTab, this._numPinnedTabs - 1); + aTab.setAttribute("fadein", "true"); aTab.removeAttribute("pinned"); aTab.style.MozMarginStart = ""; this.tabContainer._positionPinnedTabs(); @@ -1102,7 +1103,12 @@ tabContainer._handleNewTab(t); }, 0, this.tabContainer); } else { - setTimeout(function () { t.setAttribute("fadein", "true"); }, 0); + setTimeout(function (tabContainer) { + if (t.pinned) + tabContainer._handleNewTab(t); + else + t.setAttribute("fadein", "true"); + }, 0, this.tabContainer); } this.tabContainer.appendChild(t);