Skip to content

Instantly share code, notes, and snippets.

@Paratron
Created July 31, 2013 15:51
Show Gist options
  • Save Paratron/6123243 to your computer and use it in GitHub Desktop.
Save Paratron/6123243 to your computer and use it in GitHub Desktop.
Easy undo/redo with backbone
this.on('change', function(){
changes.push(this.previousAttributes());
});
undo: function(){
undone.push(this.toJSON());
this.set(changes.pop());
}
redo: function(){
this.set(undone.pop());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment