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

20
kis.js
View File

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