summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/snippets.editor.js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2016-11-23 16:44:54 +0100
committerqsm-odoo <qsm@odoo.com>2016-11-24 10:14:56 +0100
commit88912f810ffad57f9f0ac39e9690657c9ea1ba10 (patch)
tree1ce828a05206247c972102a7202e9949dffc0b41 /addons/web_editor/static/src/js/snippets.editor.js
parentdf037089bcad25727aabdf6c784caec237f35f83 (diff)
[IMP] web_editor: allow lazy loadings in Animation instance
This commit comments the code of the Animation class and allows for lazy loading of resources before animations' start methods are called. This lazy loading can be performed in the willStart method (to use the same way as in the Widget class). This commits also removes the "stop" function of the module as it was not really useful. It was used to restart the animations (by immediatly calling start again after the stop call). Now the Animation class contains a restart method and the module "start" function automatically knows if it has to instanciate an animation or restart an existing one. Animation start should only be performed by instanciating an Animation (thanks to new) or by calling the restart method, to insure the willStart method is always called. Anyway, the best way to start animations is to let the system handle them, using the "selector" attributes in your Animation definitions as before. See in-code comments for details.
Diffstat (limited to 'addons/web_editor/static/src/js/snippets.editor.js')
-rw-r--r--addons/web_editor/static/src/js/snippets.editor.js1
1 files changed, 0 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/snippets.editor.js b/addons/web_editor/static/src/js/snippets.editor.js
index 4ddda0c838e..20a96a91e84 100644
--- a/addons/web_editor/static/src/js/snippets.editor.js
+++ b/addons/web_editor/static/src/js/snippets.editor.js
@@ -1148,7 +1148,6 @@ editor.Class.include({
*/
editor.Class.include({
start: function () {
- animation.stop();
return this._super.apply(this, arguments).then(function () {
animation.start(true);
});