[BUGFIX] Scan extension by clicking panel 93/57493/3
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 6 Jul 2018 19:41:48 +0000 (21:41 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 6 Jul 2018 20:13:22 +0000 (22:13 +0200)
The extension scanner now scans an extension by opening its
panel again.

Resolves: #85440
Releases: master
Change-Id: I7b72f8c658d200c5c4d4ca90f7d6b55828c33efd
Reviewed-on: https://review.typo3.org/57493
Reviewed-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Tested-by: Mona Muzaffar <mona.muzaffar@gmx.de>
Reviewed-by: Jürgen Venne <venne@schaffrath-digital.de>
Tested-by: Jürgen Venne <venne@schaffrath-digital.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/install/Resources/Private/Templates/Upgrade/ExtensionScanner.html
typo3/sysext/install/Resources/Public/JavaScript/Modules/ExtensionScanner.js

index 94f5cba..7be37b5 100644 (file)
@@ -94,7 +94,7 @@
                                                <div>Effective lines of code: <span class="t3js-extensionScanner-extension-body-loc">0</span></div>
                                                <div>Files ignored by scanner: <span class="t3js-extensionScanner-extension-body-ignored-files">0</span></div>
                                                <div>Code lines ignored by scanner: <span class="t3js-extensionScanner-extension-body-ignored-lines">0</span></div>
                                                <div>Effective lines of code: <span class="t3js-extensionScanner-extension-body-loc">0</span></div>
                                                <div>Files ignored by scanner: <span class="t3js-extensionScanner-extension-body-ignored-files">0</span></div>
                                                <div>Code lines ignored by scanner: <span class="t3js-extensionScanner-extension-body-ignored-lines">0</span></div>
-                                               <button class="btn btn-default t3js-extensionScanner-scan-single" data-extension="{extensionInTypo3conf.filename}" type="submit">
+                                               <button class="btn btn-default t3js-extensionScanner-scan-single" type="submit">
                                                        Scanning…
                                                </button>
                                        </div>
                                                        Scanning…
                                                </button>
                                        </div>
index e793789..4a09504 100644 (file)
@@ -33,20 +33,25 @@ define(['jquery',
       this.currentModal = currentModal;
       self.getData();
 
       this.currentModal = currentModal;
       self.getData();
 
-      currentModal.on('click', this.selectorScanSingleTrigger, function(e) {
-        // Scan a single extension
-        var extension = $(e.target).data('extension');
+      currentModal.on('show.bs.collapse', self.selectorExtensionContainer, function(e) {
+        // Scan a single extension by opening the panel
+        var $me = $(e.currentTarget);
+        if (typeof $me.data('scanned') === 'undefined') {
+          var extension = $me.data('extension');
+          self.scanSingleExtension(extension);
+          $me.data('scanned', true);
+        }
+      }).on('click', self.selectorScanSingleTrigger, function(e) {
+        // Scan a single extension by clicking "Rescan"
         e.preventDefault();
         e.preventDefault();
-        self.scanSingleExtension(extension);
-        return false;
-      });
 
 
-      currentModal.on('click', '.t3js-extensionScanner-scan-all', function(e) {
+        var extension = $(e.currentTarget).closest(self.selectorExtensionContainer).data('extension');
+        self.scanSingleExtension(extension);
+      }).on('click', '.t3js-extensionScanner-scan-all', function(e) {
         // Scan all button
         e.preventDefault();
         var $extensions = currentModal.find(self.selectorExtensionContainer);
         self.scanAll($extensions);
         // Scan all button
         e.preventDefault();
         var $extensions = currentModal.find(self.selectorExtensionContainer);
         self.scanAll($extensions);
-        return false;
       });
     },
 
       });
     },