From: Magnus Kühn Date: Mon, 11 Feb 2013 16:14:43 +0000 (+0100) Subject: Fixed icon-update in WCF.Action.Delete X-Git-Tag: 2.0.0_Beta_1~491^2^2~1^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ca42ad271b5c5a767bd6d9dcefe879c7c2fa6d72;p=GitHub%2FWoltLab%2FWCF.git Fixed icon-update in WCF.Action.Delete --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 59537da552..01af226538 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -1696,10 +1696,7 @@ WCF.Action.Delete = Class.extend({ WCF.System.Confirmation.show($target.data('confirmMessage'), $.proxy(this._execute, this), { target: $target }); } else { - if ($target.is('img')) { - $target.removeClass('icon-remove').addClass('icon-spinner'); - } - + this._updateIcon($target); this._sendRequest($target); } }, @@ -1715,13 +1712,27 @@ WCF.Action.Delete = Class.extend({ return; } - if (parameters.target.is('img')) { - parameters.target.removeClass('icon-remove').addClass('icon-spinner'); - } - + this._updateIcon(parameters.target); this._sendRequest(parameters.target); }, + /** + * Searches for an icon and updates it to a spinner. + * + * @param jQuery $target + */ + _updateIcon: function($target) { + $target.find('.icon').removeClass('icon-remove').addClass('icon-spinner'); + if ($target.is('.icon')) { + $target.removeClass('icon-remove').addClass('icon-spinner'); + } + }, + + /** + * Sends the request + * + * @param jQuery object + */ _sendRequest: function(object) { this.proxy.setOption('data', { actionName: 'delete',