From f93de3e03a720d2b0373ed31977aeb4c47c7fb69 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Tue, 18 Feb 2014 15:43:05 +0100 Subject: [PATCH 1/1] smartxml: DocumentNode.isInDocument syntactic sugar --- src/smartxml/smartxml.js | 4 ++++ 1 file changed, 4 insertions(+) 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()); }, -- 2.20.1