From cb79297a41b7747a9318fd4794dce422ee931060 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Tue, 12 Jan 2016 10:27:10 +0100 Subject: [PATCH] [FIX] web_editor: links edition (only website links) Commit f3f7bd9f240bc21dffadd784cdf77203b1a5148c adds an improvement which allows the user to edit links in an easier way. The problem is that it also allowed to edit... the edit buttons (example: the discard button). This commit moves the mentionned commit code below the code that checks if the target can be edited or not. --- addons/web_editor/static/src/js/rte.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/web_editor/static/src/js/rte.js b/addons/web_editor/static/src/js/rte.js index f50b93912ae..85721ba0387 100644 --- a/addons/web_editor/static/src/js/rte.js +++ b/addons/web_editor/static/src/js/rte.js @@ -508,6 +508,10 @@ var RTE = Widget.extend({ var $target = $(event.target); var $editable = $target.closest('.o_editable'); + if (!$editable.size()) { + return; + } + if ($target.is('a')) { $target.attr('contenteditable', true); setTimeout(function () { @@ -518,10 +522,6 @@ var RTE = Widget.extend({ $editable.attr('contenteditable', true); } - if (!$editable.size()) { - return; - } - if (this && this.$last && (!$editable.size() || this.$last[0] != $editable[0])) { var $destroy = this.$last; history.splitNext();