From 94d4c8660f01e64c8aab0324175ae3f4516a7ca6 Mon Sep 17 00:00:00 2001 From: piro Date: Thu, 6 May 2010 17:39:10 +0000 Subject: [PATCH] =?UTF-8?q?Minefield=E3=81=A7=E8=B5=B7=E5=8B=95=E7=9B=B4?= =?UTF-8?q?=E5=BE=8C=E3=81=8B=E3=82=89=E6=8A=98=E3=82=8A=E7=95=B3=E3=81=BE?= =?UTF-8?q?=E3=82=8C=E3=81=A6=E3=81=84=E3=81=9F=E3=82=BF=E3=83=96=E3=81=AE?= =?UTF-8?q?=E5=B1=95=E9=96=8B=E6=99=82=E3=81=AB=E3=82=A2=E3=83=8B=E3=83=A1?= =?UTF-8?q?=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E3=81=97=E3=81=AA=E3=81=84?= =?UTF-8?q?=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6661 599a83e7-65a4-db11-8015-0010dcdd6dc2 --- content/treestyletab/treestyletabbrowser.js | 56 ++++++++++++--------- 1 file changed, 33 insertions(+), 23 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser.js b/content/treestyletab/treestyletabbrowser.js index e89b7372..02262374 100644 --- a/content/treestyletab/treestyletabbrowser.js +++ b/content/treestyletab/treestyletabbrowser.js @@ -3940,28 +3940,11 @@ TreeStyleTabBrowser.prototype = { aTab.setAttribute(this.kCOLLAPSING_PHASE, aCollapsed ? this.kCOLLAPSING_PHASE_TO_BE_COLLAPSED : this.kCOLLAPSING_PHASE_TO_BE_EXPANDED ); - if ( - !this.animationEnabled || - aJustNow || - this.collapseDuration < 1 || -// !this.isVertical || - !this.canCollapseSubtree() - ) { - aTab.setAttribute( - 'style', - aTab.getAttribute('style') - .replace(this.collapseRulesRegExp, '') - .replace(this.kOPACITY_RULE_REGEXP, '') - ); - if (aCollapsed) - aTab.setAttribute(this.kCOLLAPSED_DONE, true); - else - aTab.removeAttribute(this.kCOLLAPSED_DONE); - return; - } + var CSSTransitionEnabled = ('Transition' in aTab.style || 'MozTransition' in aTab.style); var maxMargin; var offsetAttr; + var collapseProp = 'margin-'+this.collapseTarget; let (firstTab) { firstTab = this.getFirstTab(this.mTabBrowser); if (this.isVertical) { @@ -3986,17 +3969,41 @@ TreeStyleTabBrowser.prototype = { endOpacity = 0; } else { - aTab.setAttribute(offsetAttr, maxMargin); startMargin = maxMargin; endMargin = 0; startOpacity = 0; endOpacity = 1; } + + if ( + !this.animationEnabled || + aJustNow || + this.collapseDuration < 1 || +// !this.isVertical || + !this.canCollapseSubtree() + ) { + aTab.setAttribute( + 'style', + aTab.getAttribute('style') + .replace(this.collapseRulesRegExp, '') + .replace(this.kOPACITY_RULE_REGEXP, '') + + (CSSTransitionEnabled ? + ( + collapseProp+': -'+endMargin+'px !important;'+ + 'opacity: '+endOpacity+' !important;' + ) : + '' ) + ); + if (aCollapsed) + aTab.setAttribute(this.kCOLLAPSED_DONE, true); + else + aTab.removeAttribute(this.kCOLLAPSED_DONE); + return; + } + var deltaMargin = endMargin - startMargin; var deltaOpacity = endOpacity - startOpacity; - var collapseProp = 'margin-'+this.collapseTarget; - var CSSTransitionEnabled = ('Transition' in aTab.style || 'MozTransition' in aTab.style); if (CSSTransitionEnabled) { aTab.setAttribute( 'style', @@ -4016,7 +4023,10 @@ TreeStyleTabBrowser.prototype = { ); } - if (!aCollapsed) aTab.removeAttribute(this.kCOLLAPSED_DONE); + if (!aCollapsed) { + aTab.setAttribute(offsetAttr, maxMargin); + aTab.removeAttribute(this.kCOLLAPSED_DONE); + } var radian = 90 * Math.PI / 180; var self = this;