[BUGFIX] Show backend login spinner when getting RSA pubkey 61/45261/4
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Tue, 15 Dec 2015 08:46:32 +0000 (09:46 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Wed, 16 Dec 2015 11:49:03 +0000 (12:49 +0100)
The spinner displayed in the login button of the backend module is now
shown right after triggering the first AJAX call. Previously, it was
shown after the RSA public key was fetched.

Resolves: #71291
Releases: master
Change-Id: I24b74e3812ea69bc74f1372e902785352a90822b
Reviewed-on: https://review.typo3.org/45261
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Rudy Gnodde <rgn@windinternet.nl>
Tested-by: Rudy Gnodde <rgn@windinternet.nl>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Resources/Public/JavaScript/Login.js

index d89a5c8..0be759d 100755 (executable)
@@ -41,12 +41,18 @@ define(['jquery', 'TYPO3/CMS/Backend/jquery.clearable', 'bootstrap'], function($
         * Hide all form fields and show a progress message and icon
         */
        BackendLogin.showLoginProcess = function() {
-               $(options.submitButton).button('loading');
                $(options.error).addClass('hidden');
                $(options.errorNoCookies).addClass('hidden');
        };
 
        /**
+        * Show the loading spinner in the submit button
+        */
+       BackendLogin.showLoadingIndicator = function() {
+               $(options.submitButton).button('loading');
+       };
+
+       /**
         * Pass on to registered submit handler
         *
         * @param {Event} event
@@ -129,6 +135,7 @@ define(['jquery', 'TYPO3/CMS/Backend/jquery.clearable', 'bootstrap'], function($
         * Registers listeners for the Login Interface
         */
        BackendLogin.initializeEvents = function() {
+               $(document).ajaxStart(BackendLogin.showLoadingIndicator);
                $(options.loginForm).on('submit', BackendLogin.handleSubmit);
 
                // The Interface selector is not always present, so this check is needed