smartxml: DocumentNode.getIndex function for syntactic sugar
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Fri, 25 Oct 2013 13:32:03 +0000 (15:32 +0200)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Fri, 25 Oct 2013 13:40:26 +0000 (15:40 +0200)
src/smartxml/smartxml.js

index b469068..b4036d3 100644 (file)
@@ -78,6 +78,10 @@ $.extend(DocumentNode.prototype, {
           insertion.insertsNew = true;
         }
         return insertion;
+    },
+
+    getIndex: function() {
+        return this.parent().indexOf(this);
     }
 });