[FIX] web_editor: fix overlay missing after animation
Before this commit, with some animations (e.g. Bounce In-Left) the overlay of the animated element or the overlay of selected element inside it no longer reappeared after the animation. task-2630112 closes odoo/odoo#75444 X-original-commit: fb98430b1cdbc63896d152b39bcf23c0f2241cb4 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
@@ -226,7 +226,11 @@ var SnippetEditor = Widget.extend({
|
||||
}
|
||||
|
||||
var _animationsCount = 0;
|
||||
var postAnimationCover = _.throttle(() => this.cover(), 100);
|
||||
var postAnimationCover = _.throttle(() => {
|
||||
this.trigger_up('cover_update', {
|
||||
overlayVisible: true,
|
||||
});
|
||||
}, 100);
|
||||
this.$target.on('transitionstart.snippet_editor, animationstart.snippet_editor', () => {
|
||||
// We cannot rely on the fact each transition/animation start will
|
||||
// trigger a transition/animation end as the element may be removed
|
||||
@@ -2590,9 +2594,13 @@ var SnippetsMenu = Widget.extend({
|
||||
* Called when the overlay dimensions/positions should be recomputed.
|
||||
*
|
||||
* @private
|
||||
* @param {OdooEvent} ev
|
||||
*/
|
||||
_onOverlaysCoverUpdate: function () {
|
||||
_onOverlaysCoverUpdate: function (ev) {
|
||||
this.snippetEditors.forEach(editor => {
|
||||
if (ev.data.overlayVisible) {
|
||||
editor.toggleOverlayVisibility(true);
|
||||
}
|
||||
editor.cover();
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user