Minefield 4.0b4preでツリーを展開する時のアニメーション効果が適用されない問題を修正

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@7054 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2010-08-07 16:11:08 +00:00
parent b48a3ab481
commit 2fbf323d79

View File

@ -4334,24 +4334,13 @@ TreeStyleTabBrowser.prototype = {
var deltaMargin = endMargin - startMargin; var deltaMargin = endMargin - startMargin;
var deltaOpacity = endOpacity - startOpacity; var deltaOpacity = endOpacity - startOpacity;
if (CSSTransitionEnabled) { aTab.setAttribute(
aTab.setAttribute( 'style',
'style', aTab.getAttribute('style')
aTab.getAttribute('style') .replace(this.collapseRulesRegExp, '')+';'+
.replace(this.collapseRulesRegExp, '')+';'+ collapseProp+': -'+startMargin+'px !important;'+
collapseProp+': -'+endMargin+'px !important;'+ 'opacity: '+startOpacity+' !important;'
'opacity: '+endOpacity+' !important;' );
);
}
else {
aTab.setAttribute(
'style',
aTab.getAttribute('style')
.replace(this.collapseRulesRegExp, '')+';'+
collapseProp+': -'+startMargin+'px !important;'+
'opacity: '+startOpacity+' !important;'
);
}
if (!aCollapsed) { if (!aCollapsed) {
aTab.setAttribute(offsetAttr, maxMargin); aTab.setAttribute(offsetAttr, maxMargin);
@ -4360,7 +4349,18 @@ TreeStyleTabBrowser.prototype = {
var radian = 90 * Math.PI / 180; var radian = 90 * Math.PI / 180;
var self = this; var self = this;
var firstFrame = true;
aTab.__treestyletab__updateTabCollapsedTask = function(aTime, aBeginning, aChange, aDuration) { aTab.__treestyletab__updateTabCollapsedTask = function(aTime, aBeginning, aChange, aDuration) {
if (firstFrame && CSSTransitionEnabled) {
aTab.setAttribute(
'style',
aTab.getAttribute('style')
.replace(this.collapseRulesRegExp, '')+';'+
collapseProp+': -'+endMargin+'px !important;'+
'opacity: '+endOpacity+' !important;'
);
}
firstFrame = false;
// If this is the last tab, negative scroll happens. // If this is the last tab, negative scroll happens.
// Then, we shouldn't do animation. // Then, we shouldn't do animation.
var stopAnimation = false; var stopAnimation = false;
@ -4377,12 +4377,14 @@ TreeStyleTabBrowser.prototype = {
if (aTime >= aDuration || stopAnimation) { if (aTime >= aDuration || stopAnimation) {
delete aTab.__treestyletab__updateTabCollapsedTask; delete aTab.__treestyletab__updateTabCollapsedTask;
if (aCollapsed) aTab.setAttribute(self.kCOLLAPSED_DONE, true); if (aCollapsed) aTab.setAttribute(self.kCOLLAPSED_DONE, true);
aTab.setAttribute( if (!CSSTransitionEnabled) {
'style', aTab.setAttribute(
aTab.getAttribute('style') 'style',
.replace(self.collapseRulesRegExp, '') aTab.getAttribute('style')
.replace(self.kOPACITY_RULE_REGEXP, '') .replace(self.collapseRulesRegExp, '')
); .replace(self.kOPACITY_RULE_REGEXP, '')
);
}
aTab.removeAttribute(offsetAttr); aTab.removeAttribute(offsetAttr);
maxMargin = null; maxMargin = null;