This commit is contained in:
Nate B 2011-06-30 18:15:19 -06:00
parent 2c307ddb3b
commit 9231614a5f

30
kis.js
View File

@ -573,21 +573,29 @@
sel = $(sel); sel = $(sel);
} }
var len = sel.length; if(!sel.length)
if (len === 0)
{ {
return; // sel is a DOM Element
callback(sel);
} }
else
if (len === 1)
{ {
return callback(sel); var len = sel.length;
}
for (var x = 0; x < sel.length; x++) if (len === 0)
{ {
callback(sel[x]); return;
}
if (len === 1)
{
return callback(sel);
}
for (var x = 0; x < sel.length; x++)
{
callback(sel[x]);
}
} }
}, },
addClass: function (sel, c) addClass: function (sel, c)