summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/backend.js
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2015-10-23 13:17:25 +0200
committerNicolas Lempereur <nle@odoo.com>2015-10-26 15:25:30 +0100
commitcb238642625196b2be3c4c2e59f91cb6d608599c (patch)
tree56521d7560e626e33cf6283663815f167d782d97 /addons/web_editor/static/src/js/backend.js
parent058db898760f36262a200653c2361d2c289e6832 (diff)
[FIX] web_editor: ie issue with range within undisplayed
In IE11, when adding a range to a selection that can fail if this range is not displayed (display non on itself or an ancestor) or is not already inserted in the dom. e.g: IE fails in the following situation: http://jsfiddle.net/7cmf2tt9/7/ The feature causing this situation is minimal : it only set the cursor at the end of a FieldTextHtmlSimple widget (the default widget for fields.Html). This commit thus only ignore that error. note: this is not an issue on IE Edge. closes #9216 opw-652347
Diffstat (limited to 'addons/web_editor/static/src/js/backend.js')
-rw-r--r--addons/web_editor/static/src/js/backend.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/backend.js b/addons/web_editor/static/src/js/backend.js
index f5af01ec89c..e7c6d93853d 100644
--- a/addons/web_editor/static/src/js/backend.js
+++ b/addons/web_editor/static/src/js/backend.js
@@ -106,7 +106,10 @@ var FieldTextHtmlSimple = widget.extend({
var value = this.get('value');
this.$textarea.val(value || '');
this.$content.html(this.text_to_html(value));
- this.$content.focusInEnd();
+ // on ie an error may occur when creating range on not displayed element
+ try {
+ this.$content.focusInEnd();
+ } catch (e) {}
var history = this.$content.data('NoteHistory');
if (history && history.recordUndo()) {
this.$('.note-toolbar').find('button[data-event="undo"]').attr('disabled', false);