Skip to content

Instantly share code, notes, and snippets.

@ireneyiu
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ireneyiu/439472c3d8f231a16345 to your computer and use it in GitHub Desktop.
Save ireneyiu/439472c3d8f231a16345 to your computer and use it in GitHub Desktop.
wfApp.settings.PasswordView.submit = function(e) {
e.preventDefault();
var params = this.$el.serializeArray();
var validationResult = this.validate();
if (!validationResult.valid) {
this.$inputNew.val("").first().focus();
this.showSubmitMessage(this.$el, validationResult.errors, "failure", 3000);
} else {
this.$el.find("input").attr("disabled", true);
this.showSubmitMessage(this.$el, "Saving...");
$.post(this.submitUrl, params)
.then(this.processResponse.bind(this))
.done(this.submitSuccess.bind(this))
.fail(this.submitFail.bind(this));
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment