Skip to content

Commit

Permalink
[FIX] website_animate: fix drag n drop an animated snippet
Browse files Browse the repository at this point in the history
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#472

X-original-commit: 7c29627
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
  • Loading branch information
bvr-odoo authored and qsm-odoo committed Aug 2, 2021
1 parent 517bc3d commit 3354986
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
18 changes: 0 additions & 18 deletions website_animate/static/src/js/o_animate.editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,6 @@ function forceAnimation() {

// Animations
sOptions.registry.o_animate = sOptions.Class.extend({
/**
* @override
*/
cleanForSave: function () {
// Clean elements
this.$target.removeClass('o_animating o_animated o_animate_preview')
.css({
'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
Expand Down
8 changes: 8 additions & 0 deletions website_animate/static/src/js/o_animate.frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@ publicWidget.registry.WebsiteAnimate = publicWidget.Widget.extend({
destroy: function () {
WebsiteAnimate.$scrollingElement[0].classList.remove('o_wanim_overflow_x_hidden');
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': '',
});
},
});

Expand Down

0 comments on commit 3354986

Please sign in to comment.