Improved DOMNodeInsertedHandler
authorAlexander Ebert <ebert@woltlab.com>
Sun, 15 Jan 2012 00:01:24 +0000 (01:01 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 15 Jan 2012 00:01:24 +0000 (01:01 +0100)
Closes #376

wcfsetup/install/files/js/WCF.js

index 0027ca5df89f2d64fd58efb5ae24d76afaeda9a6..c7958198bccec69827132f2fe7081b4a1dcc0004 100644 (file)
@@ -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;
        }
 };