Add JS utility functions for working with Backbone properties.

Review Request #3694 — Created Dec. 24, 2012 and submitted — Latest diff uploaded

Information

Review Board
release-1.7.x

Reviewers

Add JS utility functions for working with Backbone properties.

This introduces $.fn.bindProperty and $.fn.bindVisibility, which makes it
easy to bind DOM element properties with Backbone properties. They can
be set to update any element property or any model property, and the
direction of synchronization (model-to-element, element-to-model, or
both) can be customized. Values can also be inversed (useful when
setting "disable" on an element from a "can*" on a model).

This also introduces unit tests for all the options and scenarios.
All unit tests pass.

I've also used this in another branch, and so far everything has
worked as expected.
    Loading...