[BUGFIX] Load icons for localization wizard properly 67/45667/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Thu, 31 Dec 2015 17:49:12 +0000 (18:49 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Thu, 7 Jan 2016 21:52:34 +0000 (22:52 +0100)
Due to the current API implementation multiple icons can't be loaded
in a single $.when() call. This causes issues after the icons are cached
as the return value of the promise changes.

The icons are fetched one by one in nested calls to workaround the issue.

Change-Id: Ifdd6622e5f4cd020dcb3a5ae76eaf0321942b936
Resolves: #72489
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/45667
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/backend/Resources/Public/JavaScript/Localization.js

index 0c03d39..64ee984 100644 (file)
@@ -63,13 +63,12 @@ define([
        };
 
        Localization.initialize = function() {
-               $.when(
-                       Icons.getIcon('actions-localize', Icons.sizes.large),
-                       Icons.getIcon('actions-edit-copy', Icons.sizes.large)
-               ).done(function(localizeIconMarkup, copyIconMarkup) {
-                       Localization.actions.translate.prepend(localizeIconMarkup[0]);
-                       Localization.actions.copy.prepend(copyIconMarkup[0]);
-                       $(Localization.identifier.triggerButton).prop('disabled', false);
+               Icons.getIcon('actions-localize', Icons.sizes.large).done(function(localizeIconMarkup) {
+                       Icons.getIcon('actions-edit-copy', Icons.sizes.large).done(function(copyIconMarkup) {
+                               Localization.actions.translate.prepend(localizeIconMarkup);
+                               Localization.actions.copy.prepend(copyIconMarkup);
+                               $(Localization.identifier.triggerButton).prop('disabled', false);
+                       });
                });
 
                $(document).on('click', Localization.identifier.triggerButton, function() {