[FIX] web_editor: open the linktool when clicking an element inlide link
Whenever we clicked on a link that contained another element (eg. span, bold, ...), the LinkTool did not open. Task-2667989 closes odoo/odoo#83437 X-original-commit: d69d26a2dd8830aca8c5922d3548e5ff59c688fc Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
@@ -246,10 +246,10 @@ const Wysiwyg = Widget.extend({
|
||||
this._updateEditorUI();
|
||||
|
||||
this.$root.on('click', (ev) => {
|
||||
const $target = $(ev.target);
|
||||
const $target = $(ev.target).closest('a');
|
||||
|
||||
// Keep popover open if clicked inside it, but not on a button
|
||||
if ($target.parents('.o_edit_menu_popover').length && !$target.parent('a').addBack('a').length) {
|
||||
if ($(ev.target).parents('.o_edit_menu_popover').length && !$target.length) {
|
||||
ev.preventDefault();
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ const Wysiwyg = Widget.extend({
|
||||
// here relies on clicking in that editor panel...
|
||||
await this.snippetsMenu._mutex.exec(() => null);
|
||||
}
|
||||
this.linkPopover = await weWidgets.LinkPopoverWidget.createFor(this, ev.target, { wysiwyg: this });
|
||||
this.linkPopover = await weWidgets.LinkPopoverWidget.createFor(this, $target[0], { wysiwyg: this });
|
||||
$target.data('popover-widget-initialized', this.linkPopover);
|
||||
})();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user