[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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user