summaryrefslogtreecommitdiff
path: root/addons/mail/static/src
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2019-03-01 15:10:28 +0100
committerAaron Bohy <aab@odoo.com>2019-03-06 20:07:17 +0100
commit53e7050ce0c1bd873f239bce8ad81ba42c19d57a (patch)
tree110bf47078ce4862cfad05aa061ba1238ebc99e6 /addons/mail/static/src
parent7a665ca92ae033072eee10584c15bb319aefac01 (diff)
[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.
Diffstat (limited to 'addons/mail/static/src')
-rw-r--r--addons/mail/static/src/js/thread_windows/abstract_thread_window.js16
1 files changed, 4 insertions, 12 deletions
diff --git a/addons/mail/static/src/js/thread_windows/abstract_thread_window.js b/addons/mail/static/src/js/thread_windows/abstract_thread_window.js
index ff5acfea0d2..7a38d337f24 100644
--- a/addons/mail/static/src/js/thread_windows/abstract_thread_window.js
+++ b/addons/mail/static/src/js/thread_windows/abstract_thread_window.js
@@ -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,7 +321,8 @@ var AbstractThreadWindow = Widget.extend({
this._focusInput();
}
}
- this._animateFold();
+ var height = this.isFolded() ? this.HEIGHT_FOLDED : this.HEIGHT_OPEN;
+ this.$el.css({height: height});
},
//--------------------------------------------------------------------------
@@ -327,17 +330,6 @@ var AbstractThreadWindow = Widget.extend({
//--------------------------------------------------------------------------
/**
- * 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.
*