mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-07 01:41:39 +00:00
Disable button when perform ajax post
This commit is contained in:
@@ -19,5 +19,5 @@
|
||||
<input type="password" name="passwd_again" disabled="disabled" class="passwd input-disabled" />
|
||||
</div>
|
||||
<p class="error hide"></p>
|
||||
<input type="submit" id="repo-create-submit" value="提交" class="submit" />
|
||||
<input type="submit" id="repo-create-submit" value="提交" class="submit"/>
|
||||
</form>
|
||||
|
@@ -21,6 +21,8 @@ $('#encrypt-switch').click(function () {
|
||||
$('#repo-create-submit').click(function() {
|
||||
var passwd = $('#repo-create-form input[name="passwd"]'),
|
||||
passwd_again = $('#repo-create-form input[name="passwd_again"]');
|
||||
var self = $(this);
|
||||
self.attr('disabled', 'disabled');
|
||||
|
||||
$.ajax({
|
||||
url: '{{ post_url }}',
|
||||
@@ -43,6 +45,7 @@ $('#repo-create-submit').click(function() {
|
||||
location.reload(true);
|
||||
} else {
|
||||
apply_form_error('repo-create-form', data['error']);
|
||||
self.removeAttr('disabled');
|
||||
}
|
||||
},
|
||||
error: function(data, textStatus, jqXHR) {
|
||||
@@ -50,6 +53,7 @@ $('#repo-create-submit').click(function() {
|
||||
$.each(errors, function(index, value) {
|
||||
apply_form_error('repo-create-form', value[0]);
|
||||
});
|
||||
self.removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user