[FIX] web_editor: do not toggle link tools/popover for extra menu items
[1] changed the event listener to toggle the link tools and the popover on links from mousedown to click. Before that, when clicking on the extra menu items toggle, the mousedown target was most of the time the icon, so the link tools and the popover were not initialized. Now, as we listen for the click event, the target is the <a/> element, for which the tools and the popover are initialized. It should not be the case, as this is a technical element that the user has no control over. task-2513588 [1]: add3e05840869d4a885ca18a2bbabfcb61c7a83d X-original-commit: f1f40517be9280c6f770a116e6909a6d147a3e43 Part-of: odoo/odoo#81351
This commit is contained in:
@@ -243,7 +243,11 @@ const Wysiwyg = Widget.extend({
|
||||
ev.preventDefault();
|
||||
}
|
||||
|
||||
if ($target.is(this.customizableLinksSelector) && $target.is('a') && !$target.attr('data-oe-model') && !$target.find('> [data-oe-model]').length) {
|
||||
if ($target.is(this.customizableLinksSelector)
|
||||
&& $target.is('a')
|
||||
&& !$target.attr('data-oe-model')
|
||||
&& !$target.find('> [data-oe-model]').length
|
||||
&& !$target[0].closest('.o_extra_menu_items')) {
|
||||
this.linkPopover = $target.data('popover-widget-initialized');
|
||||
if (!this.linkPopover) {
|
||||
// TODO this code is ugly maybe the mutex should be in the
|
||||
|
||||
Reference in New Issue
Block a user