[FIX] web_editor: edition of monetary value
Issue: if the currency is before the value and we try to add a number at the begin of the value, the number is not saved (because the browser insert the number before the span). Add a onEnableEditableArea in the rte to change the contenteditable value and the default behavior.
This commit is contained in:
@@ -546,9 +546,14 @@ var RTE = Widget.extend({
|
||||
if (dom.isImg($target[0])) {
|
||||
$target.trigger('mousedown'); // for activate selection on picture
|
||||
}
|
||||
|
||||
rte.onEnableEditableArea($editable);
|
||||
}
|
||||
},
|
||||
|
||||
onEnableEditableArea: function ($editable) {
|
||||
},
|
||||
|
||||
onMouseup: function (event) {
|
||||
var $target = $(event.target);
|
||||
var $editable = $target.closest('.o_editable');
|
||||
|
||||
@@ -597,7 +597,13 @@ rte.Class.include({
|
||||
init: function (EditorBar) {
|
||||
this._super.apply(this, arguments);
|
||||
computeFonts();
|
||||
}
|
||||
},
|
||||
onEnableEditableArea: function ($editable) {
|
||||
if ($editable.data('oe-type') === "monetary") {
|
||||
$editable.attr('contenteditable', false);
|
||||
$editable.find('.oe_currency_value').attr('contenteditable', true);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
/* list of font icons to load by editor. The icons are displayed in the media editor and
|
||||
|
||||
Reference in New Issue
Block a user