diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-09-12 12:09:11 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-09-12 12:09:11 +0200 |
| commit | c5f680200cd5a213b71584734f266630fd25cdfa (patch) | |
| tree | 0ac30ee86a7d99103e7d69f1f0ffb5fbbee9851b /addons/web_editor/static/src/js/editor/summernote.js | |
| parent | e7205b7992f55ef2cf9df9d8f2b71fafe9ed6348 (diff) | |
| parent | d08b4407be3cf9b404087056a413fbdc9eecbd9d (diff) | |
[MERGE] forward port branch saas-17 up to d08b4407be3
Diffstat (limited to 'addons/web_editor/static/src/js/editor/summernote.js')
| -rw-r--r-- | addons/web_editor/static/src/js/editor/summernote.js | 5 |
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 f054eca48eb..fa919a5a908 100644 --- a/addons/web_editor/static/src/js/editor/summernote.js +++ b/addons/web_editor/static/src/js/editor/summernote.js @@ -496,7 +496,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]); } } @@ -1082,6 +1082,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; |
