Fixes JavaScript error after failed package installation AJAX request
authorMatthias Schmidt <gravatronics@live.com>
Sat, 29 Jun 2013 22:16:09 +0000 (00:16 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 29 Jun 2013 22:16:09 +0000 (00:16 +0200)
… and adds documentation

wcfsetup/install/files/acp/js/WCF.ACP.js

index 948a9df2cfaef8f6349b2e7c19a109e41d1793d8..d484b7cfe3d0aae1afec4e27d162fda9a6050f95 100644 (file)
@@ -423,7 +423,9 @@ WCF.ACP.Package.Installation = Class.extend({
         * Handles erroneous AJAX requests.
         */
        _failure: function() {
-               this._setIcon('remove');
+               if (this._dialog !== null) {
+                       this._setIcon('remove');
+               }
                
                if (!this._allowRollback) {
                        return;
@@ -679,6 +681,11 @@ WCF.ACP.Package.Installation = Class.extend({
                this._proxy.sendRequest();
        },
        
+       /**
+        * Sets the icon with the given name as the current installation status icon.
+        * 
+        * @param       string          iconName
+        */
        _setIcon: function(iconName) {
                this._dialog.find('.jsPackageInstallationStatus').removeClass('icon-ok icon-question icon-remove icon-spinner').addClass('icon-' + iconName);
        }