X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/9ebf1ada325abec0fe83789b04f6a8af576818a4..03a3f51f2a8fd57f90b09a14001e91a4295b5278:/src/smartxml/smartxml.js diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js index a357977..6e754de 100644 --- a/src/smartxml/smartxml.js +++ b/src/smartxml/smartxml.js @@ -358,7 +358,7 @@ $.extend(Document.prototype, Backbone.Events, { }, containsNode: function(node) { - return node._$.parents().index(this.root._$) !== -1; + return this.root && (node.nativeNode === this.root.nativeNode || node._$.parents().index(this.root._$) !== -1); }, wrapNodes: function(params) {