From 0e6979fbe0c23a7d5f6720bc897258e82eaaf213 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 16 Apr 2013 15:30:07 +0200 Subject: [PATCH] Updated WCF.DOMNodeInsertedHandler's API --- wcfsetup/install/files/js/WCF.js | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 5b7c294cd2..31ba173c44 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -4385,9 +4385,9 @@ WCF.CloseOverlayHandler = { WCF.DOMNodeInsertedHandler = { /** * list of callbacks - * @var WCF.Dictionary + * @var array */ - _callbacks: new WCF.Dictionary(), + _callbacks: [ ], /** * true if DOMNodeInserted event should be ignored @@ -4423,23 +4423,7 @@ WCF.DOMNodeInsertedHandler = { this._discardEventCount = 0; this._bindListener(); - if (this._callbacks.isset(identifier)) { - console.debug("[WCF.DOMNodeInsertedHandler] identifier '" + identifier + "' is already bound to a callback"); - return false; - } - - this._callbacks.add(identifier, callback); - }, - - /** - * Removes a callback from list. - * - * @param string identifier - */ - removeCallback: function(identifier) { - if (this._callbacks.isset(identifier)) { - this._callbacks.remove(identifier); - } + this._callbacks.push(callback); }, /** @@ -4462,10 +4446,9 @@ WCF.DOMNodeInsertedHandler = { // do not track events while executing callbacks this._isExecuting = true; - this._callbacks.each(function(pair) { - // execute callback - pair.value(); - }); + for (var $i = 0, $length = this._callbacks.length; $i < $length; $i++) { + this._callbacks[$i](); + } // enable listener again this._isExecuting = false; -- 2.20.1