Created
April 5, 2013 11:11
-
-
Save benw/5318523 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
$('button.accept-terms').click(function (e) { | |
$(e.target).attr('disabled', 'disabled'); | |
$.ajax({ | |
type: 'POST', | |
url: '/settings', | |
data: { | |
_csrf: window._csrf, | |
accept_terms: true | |
}, | |
success: function (data, textStatus, jqXHR) { | |
window.terms_accepted = true; | |
$('#termsModal').modal('hide'); | |
if (inputToFocus) $(inputToFocus).focus(); | |
}, | |
error: function (jqXHR, textStatus, errorThrown) { | |
$(e.target).removeAttr('disabled'); | |
console.log('POST /settings error: ' + textStatus + ' - ' + errorThrown); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment