summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/users.js
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2014-04-23 16:54:40 +0200
committerAzul <azul@leap.se>2014-04-25 12:18:40 +0200
commite727d211630591a3aaed5eba0eb50c7d4964b6f8 (patch)
treef9cbbadfe6fe7bdb9354fdb0d3e43ffbce30c1dd /app/assets/javascripts/users.js
parent6c13d3323c180a333fd0f32d17a62adce9fcf2bb (diff)
ensure buttons are properly loading... and reset
Diffstat (limited to 'app/assets/javascripts/users.js')
-rw-r--r--app/assets/javascripts/users.js21
1 files changed, 3 insertions, 18 deletions
diff --git a/app/assets/javascripts/users.js b/app/assets/javascripts/users.js
index 8486756..4a86ef5 100644
--- a/app/assets/javascripts/users.js
+++ b/app/assets/javascripts/users.js
@@ -35,24 +35,10 @@
data: $(form).serialize()
});
req.done( function() {
- $(form).find('input[type="submit"]').button('reset');
+ $(form).find('.btn[type="submit"]').button('reset');
});
};
-
- markAsSubmitted = function(submitEvent) {
- var form = submitEvent.target;
- $(form).addClass('submitted')
- // bootstrap loading state:
- $(form).find('input[type="submit"]').button('loading');
- };
-
- resetButtons = function(submitEvent) {
- var form = $('form.submitted')
- // bootstrap loading state:
- $(form).find('input[type="submit"]').button('reset');
- $(form).removeClass('submitted')
- };
-
+
//
// PUBLIC FUNCTIONS
//
@@ -79,7 +65,7 @@
clear_errors();
var errors = extractErrors(message);
displayErrors(errors);
- resetButtons();
+ $('.btn[type="submit"]').button('reset');
}
function extractErrors(message) {
@@ -115,7 +101,6 @@
//
$(document).ready(function() {
- $('form').submit(markAsSubmitted);
$('#new_user').submit(prevent_default);
$('#new_user').submit(srp.signup);
$('#new_session').submit(prevent_default);