X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/9f6d1535529f8d33732ecaac54bbd56afb536b0f..5145fc38a6bf044367f4d96197dd3d47e05b6266:/src/smartxml/smartxml.js diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js index b449d82..a5a1abc 100644 --- a/src/smartxml/smartxml.js +++ b/src/smartxml/smartxml.js @@ -578,7 +578,6 @@ $.extend(Document.prototype, Backbone.Events, fragments, { if(transformations.length > 1) { // In case of real transactions we don't want to run undo on all of transformations if we don't have to. - stopAt = undefined; transformations.some(function(t, idx) { if(!t.undo && t.getChangeRoot().sameNode(doc.root)) { stopAt = idx; @@ -666,8 +665,11 @@ $.extend(Document.prototype, Backbone.Events, fragments, { getNodeByPath: function(path) { var toret = this.root; - path.forEach(function(idx) { + path.some(function(idx) { toret = toret.contents()[idx]; + if(!toret) { + return true; + } }); return toret; },