summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/lib/summernote/src/js/EventHandler.js
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2019-02-13 17:15:58 +0000
committerNicolas Lempereur <nle@odoo.com>2019-02-13 17:21:19 +0000
commit0857737f8c5c2adf4f4f96cc203169c04e27d720 (patch)
tree088094dd158996d79f3c31770e8e30ee400a66d2 /addons/web_editor/static/lib/summernote/src/js/EventHandler.js
parent1e43c73a9983d48d85b899d6db323290e961a84c (diff)
[FIX] web_editor: focus lost with inline editor
When an inline editor is eg. in a form view, the focus is always stolen by it. This is because we trigger a mouseup on the editor to update its toolbars values and informations. note: backport of 11.0's 7a453b0b7ae In 10.0 this trigger could cause a "blur" which in some instance is not wanted (eg. inside a newline of a list view). opw-1906581 closes #31078
Diffstat (limited to 'addons/web_editor/static/lib/summernote/src/js/EventHandler.js')
-rw-r--r--addons/web_editor/static/lib/summernote/src/js/EventHandler.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/addons/web_editor/static/lib/summernote/src/js/EventHandler.js b/addons/web_editor/static/lib/summernote/src/js/EventHandler.js
index 1cb9cd8e1c7..d8dcbe18a8b 100644
--- a/addons/web_editor/static/lib/summernote/src/js/EventHandler.js
+++ b/addons/web_editor/static/lib/summernote/src/js/EventHandler.js
@@ -207,11 +207,15 @@ define([
var layoutInfo = dom.makeLayoutInfo(target);
/* ODOO: (start_modification */
var $editable = layoutInfo.editable();
- if (!event.isDefaultPrevented()) {
- modules.editor.saveRange($editable);
+ if (event.setStyleInfoFromEditable) {
+ var styleInfo = modules.editor.styleFromNode($editable);
+ } else {
+ if (!event.isDefaultPrevented()) {
+ modules.editor.saveRange($editable);
+ }
+ var styleInfo = modules.editor.currentStyle(target);
}
/* ODOO: end_modification) */
- var styleInfo = modules.editor.currentStyle(target);
self.updateStyleInfo(styleInfo, layoutInfo);
}, 0);
};