[BUGFIX] Fix update button in Extension Manager 12/37612/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 6 Mar 2015 18:39:41 +0000 (19:39 +0100)
committerMarkus Klein <klein.t3@reelworx.at>
Fri, 6 Mar 2015 19:00:29 +0000 (20:00 +0100)
The change If527b0e8fd77a059c8b25db16a926c5c80356331 introduced
a regression which broke the event listeners for the update buttons.
Change the JavaScript code to match the new markup.

Resolves: #65580
Releases: master
Change-Id: Ifbf857c88fad10f6e0411c48dadacf85bcfa425c
Reviewed-on: http://review.typo3.org/37612
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Markus Klein <klein.t3@reelworx.at>
Tested-by: Markus Klein <klein.t3@reelworx.at>
typo3/sysext/extensionmanager/Resources/Private/Templates/List/Index.html
typo3/sysext/extensionmanager/Resources/Public/JavaScript/Main.js

index d851598..e6c5103 100644 (file)
@@ -62,6 +62,7 @@
                                                                                        uri="{f:uri.action(action:'updateCommentForUpdatableVersions',controller:'Download',arguments:{extension:extension.key, integerVersion: extension.terObject.integerVersion},format:'json')}"
                                                                                        icon="actions-system-extension-update"
                                                                                        title="{f:translate(key:'extensionList.updateToVersion', arguments:{0:extension.updateToVersion.version})}"
+                                                                                       additionalAttributes="{data-action:'update-extension'}"
                                                                                />
                                                                        </span>
                                                                </f:else>
index df90a01..bda9eae 100644 (file)
@@ -97,20 +97,15 @@ define(['jquery', 'datatables', 'jquery/jquery.clearable'], function($) {
                        });
                });
 
-               $('.t3-icon-system-extension-update').parent().each(function() {
-                       var $me = $(this);
-                       $me.data('href', $me.attr('href'));
-                       $me.attr('href', '#');
-                       $me.addClass('transformed');
-                       $me.click(function() {
-                               $.ajax({
-                                       url: $(this).data('href'),
-                                       dataType: 'json',
-                                       beforeSend: function() {
-                                               $(ExtensionManager.identifier.extensionManager).mask();
-                                       },
-                                       success: ExtensionManager.updateExtension
-                               });
+               $('a[data-action=update-extension]').click(function(e) {
+                       e.preventDefault();
+                       $.ajax({
+                               url: $(this).attr('href'),
+                               dataType: 'json',
+                               beforeSend: function() {
+                                       $(ExtensionManager.identifier.extensionManager).mask();
+                               },
+                               success: ExtensionManager.updateExtension
                        });
                });
        };