Fixed issues with number of elements returned by selector in dom module

This commit is contained in:
Timothy Warren 2011-06-21 13:45:40 -04:00
parent a21c00f43a
commit e3cf259a93

34
kis.js
View File

@ -412,6 +412,12 @@
{
sel = _sel(sel);
if(sel.length < 2)
{
callback(sel);
return;
}
for(var x in sel)
{
callback(sel[x]);
@ -436,10 +442,17 @@
hide: function(sel)
{
sel = _sel(sel);
this.each(sel, function(e){
e.style.display = "none";
});
if(sel.length > 1)
{
this.each(sel, function(e){
e.style.display = "none";
});
}
else
{
sel.style.display = "none";
}
},
show: function(sel, type)
@ -451,9 +464,16 @@
type="block";
}
this.each(sel, function(e){
e.style.display = type;
});
if(sel.length > 1)
{
this.each(sel, function(e){
e.style.display = type;
});
}
else
{
sel.style.display = type;
}
}
};