summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/rte.js
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2015-12-08 17:36:53 +0100
committerChristophe Matthieu <chm@odoo.com>2015-12-15 10:47:50 +0100
commitf3f7bd9f240bc21dffadd784cdf77203b1a5148c (patch)
treeb0786c72d7ad11524d71e168a0e832d7eae95e53 /addons/web_editor/static/src/js/rte.js
parent8e81abfeb55babb1d147901138efb23c02a00746 (diff)
[FIX] web_editor: help the user to edit the link
User can't edit the first and last chars of a link (same issue for a lot of editors), and users don't want to click on edit link button in the editor bar. When the user click (not if the user use arrow) on a link the link is activate with a content editable true and can edit the first and last chars. opw: 654280
Diffstat (limited to 'addons/web_editor/static/src/js/rte.js')
-rw-r--r--addons/web_editor/static/src/js/rte.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/rte.js b/addons/web_editor/static/src/js/rte.js
index c107ca342ae..f50b93912ae 100644
--- a/addons/web_editor/static/src/js/rte.js
+++ b/addons/web_editor/static/src/js/rte.js
@@ -508,6 +508,16 @@ var RTE = Widget.extend({
var $target = $(event.target);
var $editable = $target.closest('.o_editable');
+ if ($target.is('a')) {
+ $target.attr('contenteditable', true);
+ setTimeout(function () {
+ $editable.attr('contenteditable', false);
+ });
+ } else if ($editable.attr('contenteditable') === 'false') {
+ $target.removeAttr('contenteditable');
+ $editable.attr('contenteditable', true);
+ }
+
if (!$editable.size()) {
return;
}