summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/editor/summernote.js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2017-08-04 14:09:05 +0200
committerqsm-odoo <qsm@odoo.com>2017-08-28 12:04:06 +0200
commit9486ec33c4035fe6155e0a9d5905ee38106761fa (patch)
treee3a940b9790ddb29405f6756de95764f7e8c7d74 /addons/web_editor/static/src/js/editor/summernote.js
parent3fb4159ad9c9b9488912292b7b339d9f1fd2ce3c (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/summernote.js')
-rw-r--r--addons/web_editor/static/src/js/editor/summernote.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/editor/summernote.js b/addons/web_editor/static/src/js/editor/summernote.js
index 4860931ea6b..f054eca48eb 100644
--- a/addons/web_editor/static/src/js/editor/summernote.js
+++ b/addons/web_editor/static/src/js/editor/summernote.js
@@ -649,7 +649,10 @@ dom.isNotBreakable = function (node) {
return !dom.isText(node) && !dom.isBR(dom.firstChild(node)) && dom.isVoid(dom.firstChild(node));
};
dom.isContentEditable = function (node) {
- return $(node).closest('[contenteditable]').is('[contenteditable="true"]');
+ return $(node).closest('[contenteditable]').prop('contenteditable') === 'true';
+};
+dom.isContentEditableFalse = function (node) {
+ return $(node).closest('[contenteditable]').prop('contenteditable') === 'false';
};
dom.isFont = function (node) {
var nodeName = node && node.nodeName.toUpperCase();