Minefieldで起動直後から折り畳まれていたタブの展開時にアニメーションしない問題を修正
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6661 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
804d383ff2
commit
94d4c8660f
@ -3940,28 +3940,11 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
|
|
||||||
aTab.setAttribute(this.kCOLLAPSING_PHASE, aCollapsed ? this.kCOLLAPSING_PHASE_TO_BE_COLLAPSED : this.kCOLLAPSING_PHASE_TO_BE_EXPANDED );
|
aTab.setAttribute(this.kCOLLAPSING_PHASE, aCollapsed ? this.kCOLLAPSING_PHASE_TO_BE_COLLAPSED : this.kCOLLAPSING_PHASE_TO_BE_EXPANDED );
|
||||||
|
|
||||||
if (
|
var CSSTransitionEnabled = ('Transition' in aTab.style || 'MozTransition' in aTab.style);
|
||||||
!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 maxMargin;
|
var maxMargin;
|
||||||
var offsetAttr;
|
var offsetAttr;
|
||||||
|
var collapseProp = 'margin-'+this.collapseTarget;
|
||||||
let (firstTab) {
|
let (firstTab) {
|
||||||
firstTab = this.getFirstTab(this.mTabBrowser);
|
firstTab = this.getFirstTab(this.mTabBrowser);
|
||||||
if (this.isVertical) {
|
if (this.isVertical) {
|
||||||
@ -3986,17 +3969,41 @@ TreeStyleTabBrowser.prototype = {
|
|||||||
endOpacity = 0;
|
endOpacity = 0;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
aTab.setAttribute(offsetAttr, maxMargin);
|
|
||||||
startMargin = maxMargin;
|
startMargin = maxMargin;
|
||||||
endMargin = 0;
|
endMargin = 0;
|
||||||
startOpacity = 0;
|
startOpacity = 0;
|
||||||
endOpacity = 1;
|
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 deltaMargin = endMargin - startMargin;
|
||||||
var deltaOpacity = endOpacity - startOpacity;
|
var deltaOpacity = endOpacity - startOpacity;
|
||||||
var collapseProp = 'margin-'+this.collapseTarget;
|
|
||||||
|
|
||||||
var CSSTransitionEnabled = ('Transition' in aTab.style || 'MozTransition' in aTab.style);
|
|
||||||
if (CSSTransitionEnabled) {
|
if (CSSTransitionEnabled) {
|
||||||
aTab.setAttribute(
|
aTab.setAttribute(
|
||||||
'style',
|
'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 radian = 90 * Math.PI / 180;
|
||||||
var self = this;
|
var self = this;
|
||||||
|
Loading…
Reference in New Issue
Block a user