Created
January 25, 2013 23:52
-
-
Save jrolfs/4638969 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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