[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
This commit is contained in:
Christophe Matthieu
2015-12-15 10:47:50 +01:00
parent 8e81abfeb5
commit f3f7bd9f24
+10
View File
@@ -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;
}