diff options
| author | qsm-odoo <qsm@odoo.com> | 2017-10-27 15:28:43 +0200 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2017-10-30 10:46:22 +0100 |
| commit | 81fffdbdc4ae23e6d08cf1207dc14bf52156244e (patch) | |
| tree | b04913c3c0476cc2ed6629625a7ac229997eecaf /addons | |
| parent | a9274dcd24c9d6d74c0ba88175be2193f68a2525 (diff) | |
[FIX] website: restore snippet animation API
Before the website refactoring, snippet animations were cleaned thanks
to the `stop` method. As those animations are now extensions of the
standard `Widget` class, the `stop` method was replaced by the standard
`destroy` method. This was tweaked so that the $el is not removed from
the DOM, but with proper cleaning of events. However, this changed the
way the `stop` method content has to be called. Indeed, we should be
allowed to call the `_super` method and then use the $el variable.
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/website/static/src/js/content/snippets.animation.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/addons/website/static/src/js/content/snippets.animation.js b/addons/website/static/src/js/content/snippets.animation.js index 466913e7188..725b6b1d66b 100644 --- a/addons/website/static/src/js/content/snippets.animation.js +++ b/addons/website/static/src/js/content/snippets.animation.js @@ -343,12 +343,19 @@ var Animation = Widget.extend({ * Also stops animation effects and destroys them if any. */ destroy: function () { + var $oldel = this.$el; // The difference with the default behavior is that we unset the // associated element first so that: // 1) its events are unbinded // 2) it is not removed from the DOM this.setElement(null); this._super.apply(this, arguments); + // Reassign the variables afterwards to allow extensions to use them + // after calling the _super method + this.$el = $oldel; + this.el = $oldel[0]; + this.$target = this.$el; + this.target = this.el; }, /** * @override |
