[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) <qsm@odoo.com>
This commit is contained in:
Benjamin Vray
2020-10-08 14:24:53 +00:00
parent 426882bc60
commit d8e547ceab
2 changed files with 13 additions and 19 deletions
@@ -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
@@ -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