Fixed dialog id collision
authorAlexander Ebert <ebert@woltlab.com>
Thu, 17 Nov 2016 11:50:00 +0000 (12:50 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 17 Nov 2016 11:50:11 +0000 (12:50 +0100)
wcfsetup/install/files/js/WCF.User.js

index bac8b6a67d547022ffb3f7c0c43970d2720ccc0b..ab8031be025a648f40670ef53ef01a59e3bb4064 100644 (file)
@@ -2469,8 +2469,11 @@ WCF.User.List = Class.extend({
                if (this._cache[this._pageNo]) {
                        var $dialogCreated = false;
                        if (this._dialog === null) {
-                               this._dialog = $('<div id="userList' + this._className.hashCode() + '" />').hide().appendTo(document.body);
-                               $dialogCreated = true;
+                               this._dialog = $('#userList' + this._className.hashCode());
+                               if (this._dialog.length === 0) {
+                                       this._dialog = $('<div id="userList' + this._className.hashCode() + '" />').hide().appendTo(document.body);
+                                       $dialogCreated = true;
+                               }
                        }
                        
                        // remove current view