From: Alexander Ebert Date: Sat, 13 Dec 2014 23:28:27 +0000 (+0100) Subject: Fixed WCF.Action.Delete sometimes triggering to early X-Git-Tag: 2.1.0_Beta_1~28 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4ab96099527fc6f37267782256b4924c8296f435;p=GitHub%2FWoltLab%2FWCF.git Fixed WCF.Action.Delete sometimes triggering to early --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 59b27a1b9b..53c2e17198 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -2822,16 +2822,19 @@ WCF.Action.Delete = Class.extend({ * Initializes available element containers. */ _initElements: function() { - var self = this; - $(this._containerSelector).each(function(index, container) { + $(this._containerSelector).each((function(index, container) { var $container = $(container); var $containerID = $container.wcfIdentify(); - if (!WCF.inArray($containerID, self._containers)) { - self._containers.push($containerID); - $container.find(self._buttonSelector).click($.proxy(self._click, self)); + if (!WCF.inArray($containerID, this._containers)) { + var $deleteButton = $container.find(this._buttonSelector); + + if ($deleteButton.length) { + this._containers.push($containerID); + $deleteButton.click($.proxy(this._click, this)); + } } - }); + }).bind(this)); }, /**