Shoult it have toggleClass?
AlexNolasco opened this issue · comments
Alex Nolasco commented
Should XUI have toggleClass for convenience sake?
/* perhaps something like this */
function toggleClass (className){
var self = this;
if (className !== undefined) {
this.each(function(el) {
if(hasClass(el, className)){
x$(el).removeClass(className);
} else {
x$(el).addClass(className);
}
});
}
return this;
}
Fil Maj commented
gets my vote.