diff options
Diffstat (limited to 'addons/web_editor/static/src/js/summernote.js')
| -rw-r--r-- | addons/web_editor/static/src/js/summernote.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/addons/web_editor/static/src/js/summernote.js b/addons/web_editor/static/src/js/summernote.js index e4d1c5b27c4..775c4398268 100644 --- a/addons/web_editor/static/src/js/summernote.js +++ b/addons/web_editor/static/src/js/summernote.js @@ -210,7 +210,7 @@ dom.merge = function (node, begin, so, end, eo, mergeFilter, all) { while(end.lastChild) {end = end.lastChild;} eo = end.textContent.length-1; } else if (end.tagName) { - + } else if (end.tagName && end.childNodes[so]) { end = end.childNodes[so]; so = 0; @@ -234,7 +234,7 @@ dom.merge = function (node, begin, so, end, eo, mergeFilter, all) { if (cur === begin) { if (!all) add = true; } - + __merge(cur); dom.orderClass(dom.node(cur)); @@ -1501,7 +1501,7 @@ $.summernote.pluginEvents.backspace = function (event, editor, layoutInfo) { dom.removeSpace(temp2.parentNode, temp2, 0, temp, 0); // clean before jump for not select invisible space between 2 tag temp2 = dom.lastChild(temp2); - + r = range.create(temp2, temp2.textContent.length, temp2, temp2.textContent.length); r.select(); @@ -1876,11 +1876,11 @@ eventHandler.modules.toolbar.button.updateRecentColor = function (elBtn, sEvent, font.style.color = sValue !== 'inherit' ? sValue : ""; } } else { + font.className = font.className.replace(/(^|\s+)bg-\S+/, ''); if (sValue.indexOf('bg-') !== -1) { font.className += ' ' + sValue; font.style.backgroundColor = ""; } else { - font.className = font.className.replace(/(^|\s+)bg-\S+/); font.style.backgroundColor = sValue !== 'inherit' ? sValue : ""; } } |
