Prevent spinner from spinning on required form entry

pull/2552/head
kapito 2016-04-28 17:08:33 +01:00 zatwierdzone przez Matt Westcott
rodzic b39ff4a134
commit 7de9b51f6f
3 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -46,6 +46,7 @@ Changelog
* Fix: Redirects no longer fail when both a site-specific and generic redirect exist for the same URL path (Nick Smith, João Luiz Lorencetti)
* Fix: Wagtail now checks that Group is registered with the Django admin before unregistering it (Jason Morrison)
* Fix: Previewing inaccessible pages no longer fails with `ALLOWED_HOSTS = ['*']` (Robert Rollins)
* Fix: The submit button 'spinner' no longer activates if the form has client-side validation errors (Jack Paine, Matt Westcott)
1.4.3 (04.04.2016)

Wyświetl plik

@ -20,3 +20,4 @@ Bug fixes
* Redirects no longer fail when both a site-specific and generic redirect exist for the same URL path (Nick Smith, João Luiz Lorencetti)
* Wagtail now checks that Group is registered with the Django admin before unregistering it (Jason Morrison)
* Previewing inaccessible pages no longer fails with ``ALLOWED_HOSTS = ['*']`` (Robert Rollins)
* The submit button 'spinner' no longer activates if the form has client-side validation errors (Jack Paine, Matt Westcott)

Wyświetl plik

@ -223,6 +223,13 @@ $(function() {
var reEnableAfter = 30;
var dataName = 'disabledtimeout'
// Check the form this submit button belongs to (if any)
var form = $self.closest('form').get(0);
if (form && form.checkValidity && (form.checkValidity() == false)) {
// ^ Check form.checkValidity returns something as it may not be browser compatible
return;
}
// Disabling a button prevents it submitting the form, so disabling
// must occur on a brief timeout only after this function returns.