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) { ...@@ -24,7 +24,7 @@ TinyDOMFunction = function (selector) {
if (selector === null || typeof (selector) === 'undefined') { if (selector === null || typeof (selector) === 'undefined') {
this.length = 0; this.length = 0;
} else if (typeof (selector) === 'string') { } else if (selector.substring) {
elements = document.querySelectorAll(selector); elements = document.querySelectorAll(selector);
this.length = elements.length; this.length = elements.length;
...@@ -32,11 +32,12 @@ TinyDOMFunction = function (selector) { ...@@ -32,11 +32,12 @@ TinyDOMFunction = function (selector) {
e = elements.item(i); e = elements.item(i);
this[i] = e; this[i] = e;
} }
} else if (selector.length) { } else if (selector.push) {
for (i = 0; i < selector.length; i++) { for (i = 0; i < selector.length; i++) {
e = selector[i]; e = selector[i];
this[i] = e; this[i] = e;
} }
this.length = selector.length;
} else { } else {
this[0] = selector; this[0] = selector;
this.length = 1; 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