nytimes / backbone.trackit

Manage unsaved changes in a Backbone Model.
202 stars 33 forks source link

Added the ability to resetAttributes for specific attributes #15

Open mattbryson opened 10 years ago

mattbryson commented 10 years ago

I modified the resetAttributes to allow an array of attribute names to be passed in so ONLY those are reset, rather than the whole lot.

it drops the individual keys from the _unsavedAttrs array as well, so they are reverted.

I also modified it to use set(), so model updates are triggered to bound views - not sure if this causes any issues else where, but thought id open it up for discussion.

cheers

m