nytimes / backbone.trackit

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

Using model.set to replace attributes #10

Closed splars closed 8 years ago

splars commented 10 years ago

Model.set() will trigger built in backbone events, but simply replacing the attributes hash will not.

-Added new line as well

outdooricon commented 10 years ago

This is really important in the case of reset or cancel, especially when using stickit... This is a really good idea

splars commented 10 years ago

Hey @delambo, any chance you have time to respond to this pull request?

delambo commented 10 years ago

Thanks. I think this would be a good change. Can we also change the api so that resetAttributes takes an options object which is passed into the call to set: this.set(this._originalAttrs, options);.

alexrudall commented 8 years ago

Hi @delambo, would it be possible to merge this pull request? I want to use this excellent plugin with stickit, but this is causing an issue where the view does not update when resetAttributes is called. Many many thanks!

delambo commented 8 years ago

Sorry for the delay, and thanks for the help!

alexrudall commented 8 years ago

@delambo Hero, thank you very much! :)