[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
This commit is contained in:
Antoine Guenet
2019-02-19 09:56:32 +00:00
parent 496d7fad74
commit 6c38ed2f8d
@@ -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();
}
},