From: Aleksander Ɓukasz Date: Tue, 18 Feb 2014 14:43:05 +0000 (+0100) Subject: smartxml: DocumentNode.isInDocument syntactic sugar X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/f93de3e03a720d2b0373ed31977aeb4c47c7fb69 smartxml: DocumentNode.isInDocument syntactic sugar --- diff --git a/src/smartxml/smartxml.js b/src/smartxml/smartxml.js index 08897cc..8924e7f 100644 --- a/src/smartxml/smartxml.js +++ b/src/smartxml/smartxml.js @@ -79,6 +79,10 @@ $.extend(DocumentNode.prototype, { return this.document.root.sameNode(this); }, + isInDocument: function() { + return this.document.containsNode(this); + }, + isSiblingOf: function(node) { return node && this.parent().sameNode(node.parent()); },