summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/summernote.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-02-02 14:48:31 +0100
committerChristophe Simonis <chs@odoo.com>2016-02-02 14:48:31 +0100
commit2611a8198eaac60cf424742e4dc411700e439352 (patch)
tree64b4c0c2cbbf6199995b3f5db5e213d6813ab830 /addons/web_editor/static/src/js/summernote.js
parent7e44ddcda3f21c7e6401173539dc0fe93f9a7dd2 (diff)
parente765569d04766ca005484c4746faeb08bd917446 (diff)
[MERGE] forward port of branch saas-7 up to e765569
Diffstat (limited to 'addons/web_editor/static/src/js/summernote.js')
-rw-r--r--addons/web_editor/static/src/js/summernote.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/addons/web_editor/static/src/js/summernote.js b/addons/web_editor/static/src/js/summernote.js
index e31faaab601..e4d1c5b27c4 100644
--- a/addons/web_editor/static/src/js/summernote.js
+++ b/addons/web_editor/static/src/js/summernote.js
@@ -1065,11 +1065,6 @@ $.summernote.pluginEvents.enter = function (event, editor, layoutInfo) {
var exist = r.sc.childNodes[r.so] || r.sc;
var node = dom.node(exist);
exist = dom.isVisibleText(exist) || dom.isBR(exist) ? exist : dom.hasContentAfter(exist) || (dom.hasContentBefore(exist) || exist);
- var last = node;
- while (node && dom.isSplitable(node) && !dom.isList(node)) {
- last = node;
- node = node.parentNode;
- }
// table: add a tr
var td = dom.ancestor(node, dom.isCell);
@@ -1083,7 +1078,15 @@ $.summernote.pluginEvents.enter = function (event, editor, layoutInfo) {
dom.scrollIntoViewIfNeeded(br);
event.preventDefault();
return false;
- } else if (last === node && !dom.isBR(node)) {
+ }
+
+ var last = node;
+ while (node && dom.isSplitable(node) && !dom.isList(node)) {
+ last = node;
+ node = node.parentNode;
+ }
+
+ if (last === node && !dom.isBR(node)) {
node = r.insertNode(br, true);
if (isFormatNode(last.firstChild) && $(last).closest(options.styleTags.join(',')).length) {
dom.moveContent(last.firstChild, last);