From ca42ad271b5c5a767bd6d9dcefe879c7c2fa6d72 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Magnus=20K=C3=BChn?= Date: Mon, 11 Feb 2013 17:14:43 +0100 Subject: [PATCH] Fixed icon-update in WCF.Action.Delete --- wcfsetup/install/files/js/WCF.js | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) 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', -- 2.20.1