X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/9ce300f6e7b27995b982c14b79785e8ca4bed4f0..198de8c828e46c2a849c56091146017a9f46f4f0:/src/smartxml/smartxml.js diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js index 18664c7..5ad3010 100644 --- a/src/smartxml/smartxml.js +++ b/src/smartxml/smartxml.js @@ -38,7 +38,11 @@ $.extend(DocumentNode.prototype, { }, parent: function() { - return this.nativeNode.parentNode ? this.document.createElementNode(this.nativeNode.parentNode) : null; + var parentNode = this.nativeNode.parentNode; + if(parentNode && parentNode.nodeType === Node.ELEMENT_NODE) { + return this.document.createElementNode(parentNode); + } + return null; }, after: function(node) {