Skip to content

Instantly share code, notes, and snippets.

@jrolfs
Created January 25, 2013 23:52
Show Gist options
  • Select an option

  • Save jrolfs/4638969 to your computer and use it in GitHub Desktop.

Select an option

Save jrolfs/4638969 to your computer and use it in GitHub Desktop.
this.model.save()
.always(function () {
$button.spinContents(false);
})
.done(_.bind(function (response) { // TODO: fix error handling when we have proper codes
if (response.error) {
dispatcher.trigger('command:ShowAlert', {
icon: 'exclamation-sign',
message: 'Error ' + (this.invite ? 'inviting' : 'updating') + 'user · ' + response.error
});
} else {
this.trigger('permission:save', this.model);
}
}, this))
.fail(function (response) {
dispatcher.trigger('command:ShowAlert', {
icon: 'exclamation-sign',
message: 'Error ' + (this.invite ? 'inviting' : 'updating') + 'user'
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment