From d54959bd9d960be1331386f988b229fda4a6db30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Geelen=20=28sge=29?= Date: Thu, 29 Apr 2021 13:42:47 +0000 Subject: [PATCH] [FIX] web_editor: fix icon link edition X-original-commit: 8bb7610e8893cad692cf9ad2f5a89a503a6175ef --- addons/web_editor/static/src/js/wysiwyg/widgets/link.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/wysiwyg/widgets/link.js b/addons/web_editor/static/src/js/wysiwyg/widgets/link.js index bc685e4d5a7..06be5a9a785 100644 --- a/addons/web_editor/static/src/js/wysiwyg/widgets/link.js +++ b/addons/web_editor/static/src/js/wysiwyg/widgets/link.js @@ -177,10 +177,10 @@ const Link = Widget.extend({ */ getOrCreateLink: function (editable) { const doc = editable.ownerDocument; - const range = getDeepRange(editable, {splitText: true, select: true, correctTripleClick: true}); this.needLabel = this.needLabel || false; let link = getInSelection(doc, 'a'); const $link = $(link); + const range = getDeepRange(editable, {splitText: true, select: true, correctTripleClick: true}); if (link && (!$link.has(range.startContainer).length || !$link.has(range.endContainer).length)) { // Expand the current link to include the whole selection. let before = link.previousSibling;