[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:
@@ -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();
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user