app/assets/javascripts/trestle/components/_form.js in trestle-0.8.7 vs app/assets/javascripts/trestle/components/_form.js in trestle-0.8.8
- old
+ new
@@ -61,9 +61,11 @@
form.find(':submit').click(function() {
var button = $(this);
// Delay to ensure form is still submitted
setTimeout(function() {
- button.prop('disabled', true).addClass('loading');
+ if (form[0].checkValidity()) {
+ button.prop('disabled', true).addClass('loading');
+ }
}, 1);
});
});