Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class App.Models.RevertingModel extends Backbone.Model
- mark: ->
- @_revertAttributes = _.clone @attributes
- revert: ->
- @set(@_revertAttributes) if @_revertAttributes
- sync: (method, model, options) ->
- success = options.success
- options.success = (resp, status, xhr) =>
- success(resp, status, xhr) if success
- @mark()
- Backbone.sync(method, model, options)
Add Comment
Please, Sign In to add comment