X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/e3daf6a78b558bb2d776b389ba65a58eea1de2be..6d66ceff54d470d238250c73ab484d496bf296db:/project/static/js/lib/codemirror/undo.js?ds=sidebyside diff --git a/project/static/js/lib/codemirror/undo.js b/project/static/js/lib/codemirror/undo.js index 1930cfbd..97daf593 100644 --- a/project/static/js/lib/codemirror/undo.js +++ b/project/static/js/lib/codemirror/undo.js @@ -146,7 +146,7 @@ History.prototype = { // Commit unless there are pending dirty nodes. tryCommit: function() { if (!window.History) return; // Stop when frame has been unloaded - if (this.editor.highlightDirty()) this.commit(); + if (this.editor.highlightDirty()) this.commit(true); else this.scheduleCommit(); }, @@ -250,7 +250,7 @@ History.prototype = { function buildLine(node) { var text = []; for (var cur = node ? node.nextSibling : self.container.firstChild; - cur && cur.nodeName != "BR"; cur = cur.nextSibling) + cur && !isBR(cur); cur = cur.nextSibling) if (cur.currentText) text.push(cur.currentText); return {from: node, to: cur, text: cleanText(text.join(""))}; } @@ -275,7 +275,7 @@ History.prototype = { // Get the BR element after/before the given node. function nextBR(node, dir) { var link = dir + "Sibling", search = node[link]; - while (search && search.nodeName != "BR") + while (search && !isBR(search)) search = search[link]; return search; }