Add a $.fn.bindClass function for mapping an attribute to a class.
Review Request #4274 — Created June 30, 2013 and submitted
Add a $.fn.bindClass function for mapping an attribute to a class. bindClass is used when you want to toggle whether a class is on an element based on the value of a boolean attribute. It adds or removes the class initially based on the attribute at the time of binding, and responds to all updates to the property. Like the other binding functions, it also supports an 'inverse' option for flipping when the class will be present.
Unit tests pass. Tested with my upcoming diff viewer whitespace toggles change.
Removed usages of $(this) where possible. I switched to using 'this' for everything but the bindProperty, which doesn't let us provide a context to $el.on().
Revision 2 (+109 -7)