From 2706f6d7af4079148ec0c82027a30e8aee4bc286 Mon Sep 17 00:00:00 2001 From: Nicolas Bayet Date: Mon, 15 Nov 2021 16:02:24 +0000 Subject: [PATCH] [FIX] web_editor: prevent re-rendering of linktool Before this commit, the linktool was re-rendered clicking on same link twice. If between click, the some property of the link changed, they were lost after the linktool being needlessly re-rendered. Task-2691483 closes odoo/odoo#79820 X-original-commit: 110790cb2482367867dbc0bdaa97ad0e224a3d1e Signed-off-by: David Monjoie (dmo) --- addons/web_editor/static/src/js/wysiwyg/wysiwyg.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js index ad467c39202..9c7eb097845 100644 --- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js +++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg.js @@ -912,7 +912,9 @@ const Wysiwyg = Widget.extend({ } }; this.odooEditor.document.addEventListener('mousedown', _onMousedown, true); - this.linkTools.appendTo(this.toolbar.$el); + if (!this.linkTools.$el) { + this.linkTools.appendTo(this.toolbar.$el); + } } else { this.linkTools.destroy(); this.linkTools = undefined;