SHARE
TWEET

Untitled

a guest Jan 12th, 2019 273 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class App.Models.RevertingModel extends Backbone.Model
  2.     mark: ->
  3.         @_revertAttributes = _.clone @attributes
  4.  
  5.     revert: ->
  6.         @set(@_revertAttributes) if @_revertAttributes
  7.  
  8.     sync: (method, model, options) ->
  9.         success = options.success
  10.  
  11.         options.success = (resp, status, xhr) =>
  12.             success(resp, status, xhr) if success
  13.             @mark()
  14.  
  15.         Backbone.sync(method, model, options)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top