From: Alexander Ebert Date: Sun, 18 Jan 2015 11:08:38 +0000 (+0100) Subject: Properly removing dialogs from DOM (the editor can quickly spawn lots of them) X-Git-Tag: 2.1.0_Beta_4~69 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fc985b5d921e508df20feb6ba9d65fd0df4e1ecb;p=GitHub%2FWoltLab%2FWCF.git Properly removing dialogs from DOM (the editor can quickly spawn lots of them) --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js index 89676dafe4..6d0fcdfa4a 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wmonkeypatch.js @@ -840,9 +840,18 @@ RedactorPlugins.wmonkeypatch = function() { try { this.modal.dialog.wcfDialog('close'); - this.modal.dialog.remove(); } - catch (e) { } + catch (e) { + // ignore + } + finally { + var $container = this.modal.dialog.parents('.dialogContainer:eq(0)'); + if ($container.length) { + setTimeout(function() { + $container.remove(); + }, 500); + } + } this.modal.dialog = null; }).bind(this);