diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-04-23 14:39:41 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-04-23 14:39:41 +0200 |
| commit | 2bc3fd89f2207c3caa7e6e51ad7004ef5325ece2 (patch) | |
| tree | 91f0b7287df8f311d08f63812a3920b9c3a3a3b9 /addons/web_editor/static/src/js | |
| parent | 9f88e1f51b81229dbbf6859792430975bbdd7cd4 (diff) | |
| parent | 2d12ae3202ed93a12e1f8ff59bf64e82c0c98871 (diff) | |
[MERGE] forward port branch 10.0 up to 2d12ae3202e
Diffstat (limited to 'addons/web_editor/static/src/js')
| -rw-r--r-- | addons/web_editor/static/src/js/rte.summernote.js | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/rte.summernote.js b/addons/web_editor/static/src/js/rte.summernote.js index b8f3198dae2..2f60b1333d4 100644 --- a/addons/web_editor/static/src/js/rte.summernote.js +++ b/addons/web_editor/static/src/js/rte.summernote.js @@ -666,7 +666,15 @@ function summernote_mousedown (event) { } // restore range if range lost after clicking on non-editable area - r = range.create(); + try { + r = range.create(); + } catch (e) { + // If this code is running inside an iframe-editor and that the range + // is outside of this iframe, this will fail as the iframe does not have + // the permission to check the outside content this way. In that case, + // we simply ignore the exception as it is as if there was no range. + return; + } var editables = $(".o_editable[contenteditable], .note-editable[contenteditable]"); var r_editable = editables.has((r||{}).sc); if (!r_editable.closest('.note-editor').is($editable) && !r_editable.filter('.o_editable').is(editables)) { |
