Fixes uninstallation button in package.tpl
authorMatthias Schmidt <gravatronics@live.com>
Tue, 28 May 2013 06:39:51 +0000 (08:39 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 28 May 2013 06:39:51 +0000 (08:39 +0200)
Fixes #1288

wcfsetup/install/files/acp/js/WCF.ACP.js
wcfsetup/install/files/acp/templates/package.tpl

index 0c59710a5aa857eff6eaca6cdb7f9541300b37bc..6fc46c28ed7ca16dffb67f2d3da0ac95bdb2ae76 100644 (file)
@@ -715,7 +715,7 @@ WCF.ACP.Package.Uninstallation = WCF.ACP.Package.Installation.extend({
         * @param       object          event
         */
        _prepareQueue: function(event) {
-               var $element = $(event.target);
+               var $element = $(event.currentTarget);
                
                if ($element.data('isRequired')) {
                        new WCF.Action.Proxy({
index 9833157d73b065e9c06fb8406ad30edd4b8ecb54..ff82d88bd9b63d48373175390ae2c5cb32dc3027 100644 (file)
@@ -5,7 +5,13 @@
        $(function() {
                WCF.TabMenu.init()
                
-               new WCF.ACP.Package.Uninstallation($('.jsPackageRow .jsUninstallButton'));
+               {if PACKAGE_ID != $package->packageID && $package->canUninstall()}
+                       WCF.Language.addObject({
+                               'wcf.acp.package.uninstallation.title': '{lang}wcf.acp.package.uninstallation.title{/lang}'
+                       });
+                       
+                       new WCF.ACP.Package.Uninstallation($('.jsUninstallButton'));
+               {/if}
        });
        //]]>
 </script>
        <nav>
                <ul>
                        {if PACKAGE_ID != $package->packageID && $package->canUninstall()}
-                               <li><a href="{link controller='Package'}action=startUninstall&packageID={@$package->packageID}{/link}" onclick="return confirm('{lang}wcf.acp.package.button.uninstall.sure{/lang}')" class="button"><span class="icon icon16 icon-remove"></span> <span>{lang}wcf.acp.package.button.uninstall{/lang}</span></a></li>
+                               <li><a class="button jsUninstallButton" data-object-id="{@$package->packageID}" data-confirm-message="{lang}wcf.acp.package.uninstallation.confirm{/lang}" data-is-required="{if $package->isRequired()}true{else}false{/if}"><span class="icon icon16 icon-remove pointer jsTooltip" title="{lang}wcf.acp.package.button.uninstall{/lang}"></span> <span>{lang}wcf.acp.package.button.uninstall{/lang}</span></a></li>
                        {/if}
                        
                        {event name='contentNavigationButtonsBottom'}