From d8e547ceabe234396b23452ef2210d4ab246dfee Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Thu, 8 Oct 2020 14:24:53 +0000 Subject: [PATCH] [FIX] website_animate: fix drag n drop an animated snippet Before this commit, when drag n drop a snippet to move it in a website page, the snippet was invisible after the drop. task-2215118 closes odoo/design-themes#7 Signed-off-by: Quentin Smetz (qsm) --- .../static/src/js/o_animate.editor.js | 19 ------------------- .../static/src/js/o_animate.frontend.js | 13 +++++++++++++ 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/website_animate/static/src/js/o_animate.editor.js b/website_animate/static/src/js/o_animate.editor.js index bddca15bb..3a8327071 100644 --- a/website_animate/static/src/js/o_animate.editor.js +++ b/website_animate/static/src/js/o_animate.editor.js @@ -21,25 +21,6 @@ sOptions.registry.o_animate = sOptions.Class.extend({ onFocus: function () { this._setActive(); // Needed as in charge of hiding duration/delay/... }, - /** - * @override - */ - cleanForSave: function () { - // Clean elements - this.$target.removeClass('o_animating o_animated o_animate_preview') - .css({ - 'animation': '', - 'animation-name': '', - 'animation-play-state': '', - 'visibility': '', - }); - if (this.$target.hasClass('o_animate')) { - this.$target.css('animation-play-state', 'paused'); - } - - // Clean all inView elements - $('#wrapwrap').find('.o_animate').removeClass('o_visible'); - }, //-------------------------------------------------------------------------- // Options diff --git a/website_animate/static/src/js/o_animate.frontend.js b/website_animate/static/src/js/o_animate.frontend.js index 5de3e3bb6..c1094eeaf 100644 --- a/website_animate/static/src/js/o_animate.frontend.js +++ b/website_animate/static/src/js/o_animate.frontend.js @@ -126,6 +126,19 @@ publicWidget.registry.WebsiteAnimate = publicWidget.Widget.extend({ return this._super.apply(this, arguments); }, + /** + * @override + */ + destroy: function () { + this._super.apply(this, arguments); + this.$target.find('.o_animate') + .removeClass('o_animating o_animated o_animate_preview') + .css({ + 'animation-name': '', + 'animation-play-state': '', + 'visibility': '', + }); + }, }); // Backward compatibility for enark animation system