[REF] mail: stop using jQuery animate
Problem is that jQuery animate uses jQuery deferreds, so it may happen in tests that we fold a thread window, and we have to wait for 2 (?) nextTick to see that the window is actually folded. We use a css transition instead, which produces the exact same result.
This commit is contained in:
@@ -83,6 +83,8 @@ var AbstractThreadWindow = Widget.extend({
|
||||
displayStars: this.options.displayStars,
|
||||
});
|
||||
|
||||
// animate the (un)folding of thread windows
|
||||
this.$el.css({transition: 'height ' + this.FOLD_ANIMATION_DURATION + 'ms linear'});
|
||||
if (this.isFolded()) {
|
||||
this.$el.css('height', this.HEIGHT_FOLDED);
|
||||
} else if (this.options.autofocus) {
|
||||
@@ -319,24 +321,14 @@ var AbstractThreadWindow = Widget.extend({
|
||||
this._focusInput();
|
||||
}
|
||||
}
|
||||
this._animateFold();
|
||||
var height = this.isFolded() ? this.HEIGHT_FOLDED : this.HEIGHT_OPEN;
|
||||
this.$el.css({height: height});
|
||||
},
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// Private
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Called when there is a change of the fold state of the thread window.
|
||||
* This method animates the change of fold state of this thread window.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
_animateFold: function () {
|
||||
this.$el.animate({
|
||||
height: this.isFolded() ? this.HEIGHT_FOLDED : this.HEIGHT_OPEN
|
||||
}, this.FOLD_ANIMATION_DURATION);
|
||||
},
|
||||
/**
|
||||
* Set the focus on the composer of the thread window. This operation is
|
||||
* ignored in mobile context.
|
||||
|
||||
Reference in New Issue
Block a user