-
-
reviewboard/static/rb/js/utils/propertyUtils.js (Diff revision 1) Shouldn't "this" already be a jquery here?
Add a $.fn.bindClass function for mapping an attribute to a class.
Review Request #4274 — Created June 30, 2013 and submitted
Information | |
---|---|
chipx86 | |
Review Board | |
master | |
Reviewers | |
reviewboard | |
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.
Description | From | Last Updated |
---|---|---|
Shouldn't "this" already be a jquery here? |
|
|
just a pointing declaration, $ not required |
SA santhosh.m |
Change Summary:
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().
Diff: |
Revision 2 (+109 -7) |
---|
SA
-
-
reviewboard/static/rb/js/utils/propertyUtils.js (Diff revision 2) just a pointing declaration, $ not required