Fixed issue with wcfDialog() if element is not within the DOM
authorAlexander Ebert <ebert@woltlab.com>
Sun, 24 May 2015 17:25:42 +0000 (19:25 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 24 May 2015 17:25:42 +0000 (19:25 +0200)
wcfsetup/install/files/js/WCF.js

index 7800ac6e33690503ac74d7be4b3fb9b8ebaf5daa..e187be33046cf17c383e6195d30a30ab48c51352 100755 (executable)
@@ -9166,6 +9166,11 @@ jQuery.fn.extend({
                                }
                        }
                        else {
+                               if (this[0].parentNode === null) {
+                                       // if element is not already part of the DOM, UIDialog.open() will fail
+                                       document.body.appendChild(this[0]);
+                               }
+                               
                                UIDialog.open(id, null, (args.length === 1 && typeof args[0] === 'object') ? args[0] : {});
                        }
                }).bind(this));