From 4ab96099527fc6f37267782256b4924c8296f435 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 14 Dec 2014 00:28:27 +0100 Subject: [PATCH] Fixed WCF.Action.Delete sometimes triggering to early --- wcfsetup/install/files/js/WCF.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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)); }, /** -- 2.20.1