[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) <dmo@odoo.com>
This commit is contained in:
Nicolas Bayet
2021-11-16 10:49:39 +00:00
parent ccab4ae0ba
commit 2706f6d7af
@@ -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;