toggleClass boolean parameter proposition

toggleClass boolean parameter proposition


Hi all,
Would you accept a patch that would give the possibility to give a
boolean parameter to toggleClass ?
Eg: instead of :
    if (this.checked) {
        $(this).addClass("order_selected");
    } else {
        $(this).removeClass("order_selected");
    }
we could do :
    $(this).toggleClass("order_selected", this.checked);
The optional boolean parameter give the condition logic if either the
class should be added or removed :
true : addClass
false : removeClass
--
Fabien Meghazi
Website: http://www.amigrave.com
Email: agr@amigrave.com
IM: amigrave@gmail.com