From 6c38ed2f8d8a4e072157ad074a0ce1ec79596a05 Mon Sep 17 00:00:00 2001 From: Antoine Guenet Date: Tue, 19 Feb 2019 09:56:32 +0000 Subject: [PATCH] [FIX] web_editor: open the link modal on dblclick button descendent The link modal only opened on double-click directly on an anchor, meaning that double-clicking text in a span node within the button (as is the case in the call-to-action snippet for instance) wouldn't open the modal. Now it opens as long as we have an ancestor that is an anchor, unless the double-click occurs on a media (eg: a pictogram), in which case it should open the media's modal. closes odoo/odoo#31229 --- addons/web_editor/static/src/js/wysiwyg/plugin/link.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/wysiwyg/plugin/link.js b/addons/web_editor/static/src/js/wysiwyg/plugin/link.js index e04f3e9d340..89ec8de8887 100644 --- a/addons/web_editor/static/src/js/wysiwyg/plugin/link.js +++ b/addons/web_editor/static/src/js/wysiwyg/plugin/link.js @@ -259,7 +259,7 @@ var LinkPlugin = Plugins.linkDialog.extend({ * @param {jQueryEvent} e */ _onDblclick: function (e) { - if (dom.isAnchor(e.target)) { + if (dom.ancestor(e.target, dom.isAnchor) && !dom.isMedia(e.target)) { this.show(); } },