From: Alexander Ebert Date: Sun, 15 Jan 2012 00:01:24 +0000 (+0100) Subject: Improved DOMNodeInsertedHandler X-Git-Tag: 2.0.0_Beta_1~1425^2~10 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=901393e317dd2be9a33d82b8f857396f3be02dc1;p=GitHub%2FWoltLab%2FWCF.git Improved DOMNodeInsertedHandler Closes #376 --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 0027ca5df8..c7958198bc 100644 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -3048,18 +3048,16 @@ WCF.DOMNodeInsertedHandler = { _executeCallbacks: function(event) { if (this._isExecuting) return; - // do not track events fired within the next 100 ms + // do not track events while executing callbacks this._isExecuting = true; - new WCF.PeriodicalExecuter($.proxy(function(pe) { - this._isExecuting = false; - - pe.stop(); - }, this), 100); - + this._callbacks.each(function(pair) { // execute callback pair.value(event); }); + + // enable listener again + this._isExecuting = false; } };