diff options
| author | qsm-odoo <qsm@odoo.com> | 2017-08-04 14:09:05 +0200 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2017-08-28 12:04:06 +0200 |
| commit | 9486ec33c4035fe6155e0a9d5905ee38106761fa (patch) | |
| tree | e3a940b9790ddb29405f6756de95764f7e8c7d74 /addons/web_editor/static/src/js/editor/rte.js | |
| parent | 3fb4159ad9c9b9488912292b7b339d9f1fd2ce3c (diff) | |
[FIX] web_editor: properly not allow edition of non editable parts
Before this commit, (double) clicking an image/link in a non editable
environment still opened a dialog / change the editor bar for edition.
Diffstat (limited to 'addons/web_editor/static/src/js/editor/rte.js')
| -rw-r--r-- | addons/web_editor/static/src/js/editor/rte.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/addons/web_editor/static/src/js/editor/rte.js b/addons/web_editor/static/src/js/editor/rte.js index fb86f92b25a..f97a97b8b46 100644 --- a/addons/web_editor/static/src/js/editor/rte.js +++ b/addons/web_editor/static/src/js/editor/rte.js @@ -569,7 +569,7 @@ var RTEWidget = Widget.extend({ var $target = $(ev.target); var $editable = $target.closest('.o_editable'); - if (!$editable.length) { + if (!$editable.length || $.summernote.core.dom.isContentEditableFalse($target)) { return; } @@ -604,8 +604,7 @@ var RTEWidget = Widget.extend({ }, 150); // setTimeout to remove flickering when change to editable zone (re-create an editor) this.$last = null; } - if ($editable.length && (!this.$last || this.$last[0] !== $editable[0]) && - ($target.closest('[contenteditable]').attr('contenteditable') || '').toLowerCase() !== 'false') { + if ($editable.length && (!this.$last || this.$last[0] !== $editable[0])) { $editable.summernote(this._getConfig($editable)); $editable.data('NoteHistory', history); |
