From 0959ca1dacb2021ac092ded2e1d80ba7fef5e8d4 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 17 Apr 2013 14:38:10 +0200 Subject: [PATCH] Fixed WCF.Collapsible.Remote --- wcfsetup/install/files/js/WCF.js | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 62fe498358..19c23d4394 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -3576,24 +3576,31 @@ WCF.Collapsible.Remote = Class.extend({ */ init: function(className) { this._className = className; - - // validate containers - var $containers = this._getContainers(); - if ($containers.length == 0) { - console.debug('[WCF.Collapsible.Remote] Empty container set given, aborting.'); - } - this._proxy = new WCF.Action.Proxy({ success: $.proxy(this._success, this) }); // initialize each container - $containers.each($.proxy(function(index, container) { + this._init(); + + WCF.DOMNodeInsertedHandler.addCallback('WCF.Collapsible.Remote', $.proxy(this._init, this)); + }, + + /** + * Initializes a collapsible container. + * + * @param string containerID + */ + _init: function(containerID) { + this._getContainers().each($.proxy(function(index, container) { var $container = $(container); var $containerID = $container.wcfIdentify(); - this._containers[$containerID] = $container; - this._initContainer($containerID); + if (this._containers[$containerID] === undefined) { + this._containers[$containerID] = $container; + + this._initContainer($containerID); + } }, this)); }, -- 2.20.1