From: Alexander Ebert Date: Sun, 24 May 2015 17:25:42 +0000 (+0200) Subject: Fixed issue with wcfDialog() if element is not within the DOM X-Git-Tag: 3.0.0_Beta_1~2315 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c18a1eb57a5ae42cf484fd69c9a9e1fa20f9d61b;p=GitHub%2FWoltLab%2FWCF.git Fixed issue with wcfDialog() if element is not within the DOM --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 7800ac6e33..e187be3304 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -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));