summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-04-23 17:59:59 +0200
committerChristophe Simonis <chs@odoo.com>2018-04-23 17:59:59 +0200
commit3ab25b60bc5e13a91a518f5effd46a28b026a8f7 (patch)
tree4ab971eb25736469897d13ea10e758c9caea9b01 /addons/web_editor/static/src/js
parent30490cae89a3c528c01f470e828f11853df25126 (diff)
parentcae950e826292f5246b73eeb5d85cb1d47c76978 (diff)
[MERGE] forward port branch saas-15 up to cae950e8262
Diffstat (limited to 'addons/web_editor/static/src/js')
-rw-r--r--addons/web_editor/static/src/js/editor/rte.summernote.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/editor/rte.summernote.js b/addons/web_editor/static/src/js/editor/rte.summernote.js
index 9a2d04eeca5..15c1ef5655d 100644
--- a/addons/web_editor/static/src/js/editor/rte.summernote.js
+++ b/addons/web_editor/static/src/js/editor/rte.summernote.js
@@ -663,7 +663,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)) {