[BUGFIX] Restore clear cache menu icon if clearing fatals 66/44766/3
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Wed, 18 Nov 2015 07:55:39 +0000 (08:55 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Wed, 18 Nov 2015 16:02:21 +0000 (17:02 +0100)
Currently, the clear cache icon in the top menu only gets restored when
the clearing process was successful. If the call fails for whatever
reason, the spinner is shown until the backend is reloaded.

Change the "success" handler to "complete" to always restore the
original icon.

Resolves: #71630
Releases: master
Change-Id: I6c3758411ebb1802cd95ce09f9e74b3f888f0e59
Reviewed-on: https://review.typo3.org/44766
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Daniel Lorenz <forge@extco.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/backend/Resources/Public/JavaScript/Toolbar/ClearCacheMenu.js

index e6dbc43..5727541 100644 (file)
@@ -48,7 +48,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Icons'], function($, Icons) {
 
        /**
         * calls TYPO3 to clear a cache, then changes the topbar icon
-        * to a spinner. Once done, restores the original topbar icon
+        * to a spinner. Restores the original topbar icon when the request completed.
         *
         * @param {String} ajaxUrl the URL to load
         */
@@ -67,7 +67,7 @@ define(['jquery', 'TYPO3/CMS/Backend/Icons'], function($, Icons) {
                        url: ajaxUrl,
                        type: 'post',
                        cache: false,
-                       success: function() {
+                       complete: function() {
                                $(ClearCacheMenu.options.toolbarIconSelector, ClearCacheMenu.options.containerSelector).replaceWith($existingIcon);
                        }
                });