[FIX] web_editor: dispose of the tooltip when closing the bg-overlay
Since the migration to Bootstrap 5 (at [1]), the tooltip for the background position overlay was no longer disposed when toggling the overlay back on. This meant that new tooltips kept being added and could lead to a very confusing user interface. This was fixed for legacy widgets at [2] but the tooltip for the overlay is a specific case. This commit makes disabling the overlay also dispose of the tooltip. Steps to reproduce: - Edit a website and drop a cover snippet - Toggle the background position overlay (by clicking on the target icon) - Close the overlay (discard, save or click on the editor) - Change the Parallax option from fixed to Top to Bottom (this is just so that the previous tooltip is clearly visible after the next step) - Toggle the background overlay again => The old tooltip is still present and a new one is visible [1]: https://github.com/odoo/odoo/commit/1fcd098af5fa18e848c66bb83bdceb6ba0308512 [2]: https://github.com/odoo/odoo/commit/3c01b1cd77adec146b1a90f96bb1223a2108678b task-3119958 closes odoo/odoo#110170 X-original-commit: 2ddffeef579baf47ff117b133a9d4fbf12108a2c Signed-off-by: Bojabza Soukéina (sobo) <sobo@odoo.com>
This commit is contained in:
@@ -7222,6 +7222,9 @@ registry.BackgroundPosition = SnippetOptionWidget.extend({
|
||||
this.trigger_up('activate_snippet', {$snippet: this.$target});
|
||||
|
||||
$(document).off('click.bgposition');
|
||||
if (this.$bgDragger) {
|
||||
this.$bgDragger.tooltip('dispose');
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user