[FIX] web_editor: prevent opening linktool on uneditable links

Before this commit
When trying to open the linktool on link that are not
`isContentEditable`, the linktool was initialized and not
showed in the sidebar.

After this commit
As it does not make sense to edit a link that is not editable,
prevent the linktool from being initialized in the first place.

task-2802592

closes odoo/odoo#87203

X-original-commit: 4a634f2c5bfceb3f2dc200f9b391ef1cdbc0e697
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
Nicolas Bayet
2022-03-24 18:10:55 +01:00
parent ad7c0d8ea4
commit 6b8bf0dd41
@@ -282,6 +282,7 @@ const Wysiwyg = Widget.extend({
if ($target.is(this.customizableLinksSelector)
&& $target.is('a')
&& $target[0].isContentEditable
&& !$target.attr('data-oe-model')
&& !$target.find('> [data-oe-model]').length
&& !$target[0].closest('.o_extra_menu_items')) {