Skip to content

Instantly share code, notes, and snippets.

@boxxxie
Created April 2, 2012 19:46
Show Gist options
  • Select an option

  • Save boxxxie/2286692 to your computer and use it in GitHub Desktop.

Select an option

Save boxxxie/2286692 to your computer and use it in GitHub Desktop.
fetch:function (options) {
if(_.isFunction(options)){
var callback = options;
var newOptions = {
success : function(resp, status, xhr){
callback(null,resp, status, xhr)
},
error : function(){
callback()
}
}
}
else if (_.isUndefined(options)){
var newOptions = {};
}
else{
var newOptions = options
}
Backbone.Model.prototype.fetch.call(this,newOptions);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment