Skip to content
Snippets Groups Projects
Commit b0e1efab authored by Commander-lol's avatar Commander-lol
Browse files

Fixed constructor of batch when passing zero length array

parent a8fdcd1d
No related branches found
No related tags found
No related merge requests found
......@@ -24,7 +24,7 @@ TinyDOMFunction = function (selector) {
if (selector === null || typeof (selector) === 'undefined') {
this.length = 0;
} else if (typeof (selector) === 'string') {
} else if (selector.substring) {
elements = document.querySelectorAll(selector);
this.length = elements.length;
......@@ -32,11 +32,12 @@ TinyDOMFunction = function (selector) {
e = elements.item(i);
this[i] = e;
}
} else if (selector.length) {
} else if (selector.push) {
for (i = 0; i < selector.length; i++) {
e = selector[i];
this[i] = e;
}
this.length = selector.length;
} else {
this[0] = selector;
this.length = 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment