From fc985b5d921e508df20feb6ba9d65fd0df4e1ecb Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 18 Jan 2015 12:08:38 +0100 Subject: [PATCH] Properly removing dialogs from DOM (the editor can quickly spawn lots of them) --- .../js/3rdParty/redactor/plugins/wmonkeypatch.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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); -- 2.20.1