[BUGFIX] Use jQuery iterator for proper contextual variable handover 71/56771/2
authorRalf Zimmermann <ralf.zimmermann@tritum.de>
Fri, 20 Apr 2018 21:21:12 +0000 (23:21 +0200)
committerAndreas Fernandez <a.fernandez@scripting-base.de>
Sat, 21 Apr 2018 08:21:42 +0000 (10:21 +0200)
Use jQuery's each() method to handover variables from within the loop
to objects which are decoupled through jQuery's promise() method.

Resolves: #84826
Releases: master
Change-Id: I140a586b2fd6a0483d415d4618dfcf148a466dea
Reviewed-on: https://review.typo3.org/56771
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Björn Jacob <bjoern.jacob@tritum.de>
Tested-by: Björn Jacob <bjoern.jacob@tritum.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
typo3/sysext/form/Resources/Public/JavaScript/Backend/FormEditor/InspectorComponent.js

index e6ba2da..94422a7 100644 (file)
@@ -2393,10 +2393,7 @@ define(['jquery',
             formElementSelectorSplitButtonListContainer.append(itemTemplate);
           });
         } else {
-          for (var i = 0, len = nonCompositeNonToplevelFormElements.length; i < len; ++i) {
-            var nonCompositeNonToplevelFormElement;
-
-            nonCompositeNonToplevelFormElement = nonCompositeNonToplevelFormElements[i];
+          $.each(nonCompositeNonToplevelFormElements, function(i, nonCompositeNonToplevelFormElement) {
             Icons.getIcon(
               getFormElementDefinition(nonCompositeNonToplevelFormElement, 'iconIdentifier'),
               Icons.sizes.small,
@@ -2430,7 +2427,7 @@ define(['jquery',
 
               formElementSelectorSplitButtonListContainer.append(itemTemplate);
             });
-          }
+          });
         }
       } else {
         $(getHelper().getDomElementDataIdentifierSelector('editorControlsInputGroup'), editorHtml)