From 64226b9a37b822a0c675aba0dedacb38ec1752f8 Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 21 Aug 2014 13:05:41 +0200 Subject: [PATCH] add Ox..is() --- source/Ox/js/DOM.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/Ox/js/DOM.js b/source/Ox/js/DOM.js index b022b515..42cadfe2 100644 --- a/source/Ox/js/DOM.js +++ b/source/Ox/js/DOM.js @@ -236,6 +236,12 @@ Ox.$ = Ox.element = function(value) { return this; }, /*@ + is Returns true if the element matches the query + @*/ + is: function(query) { + return Ox.contains(this.parent().querySelectorAll(query), this[0]); + }, + /*@ next Returns the sibling after this element () -> Next element @*/