diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-09-11 11:45:44 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-09-11 11:45:44 +0200 |
| commit | 48f88992da66a12eb0653a8a69b7d4e0e9389d9e (patch) | |
| tree | b041dc44e6c7cf9a5168d4bf9ebc59c0205ca26c /addons/web_editor/static/src/js/summernote.js | |
| parent | 4e2db85f2e10cfd53abb7c1e27d4ca4986ae89c9 (diff) | |
| parent | 7d7e94c6ef4257dc0c2a7fed7bd7d40ed914a50a (diff) | |
[MERGE] forward port branch 10.0 up to 7d7e94c6ef4
Diffstat (limited to 'addons/web_editor/static/src/js/summernote.js')
| -rw-r--r-- | addons/web_editor/static/src/js/summernote.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/summernote.js b/addons/web_editor/static/src/js/summernote.js index 71647828cc6..d28279d57ed 100644 --- a/addons/web_editor/static/src/js/summernote.js +++ b/addons/web_editor/static/src/js/summernote.js @@ -504,7 +504,7 @@ dom.removeBetween = function (sc, so, ec, eo, towrite) { }; for (var i=0; i<nodes.length; i++) { - if (!dom.ancestor(nodes[i], ancestor_first_last) && !$.contains(nodes[i], before) && !$.contains(nodes[i], after)) { + if (!dom.ancestor(nodes[i], ancestor_first_last) && !$.contains(nodes[i], before) && !$.contains(nodes[i], after) && !dom.isEditable(nodes[i])) { nodes[i].parentNode.removeChild(nodes[i]); } } @@ -1121,6 +1121,9 @@ $.summernote.pluginEvents.enter = function (event, editor, layoutInfo) { // double enter on the end of a blockquote & pre = new line out of the list $('<p></p>').append(br).insertAfter($(r.sc).closest('blockquote, pre')); node = br; + } else if (dom.isEditable(dom.node(r.sc))) { + // if we are directly in an editable, only SHIFT + ENTER should add a newline + node = null; } else if (last === r.sc) { if (dom.isBR(last)) { last = last.parentNode; |
