From feb4f845a840f43c923c764b7c7090b778c0d994 Mon Sep 17 00:00:00 2001 From: eastargh Date: Fri, 5 Jun 2026 10:11:21 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8C=9D=EC=97=85=20=EB=91=90=EB=B2=88?= =?UTF-8?q?=EC=A7=B8=20=EC=9D=B4=ED=9B=84=20=EC=98=A4=ED=94=88=EC=8B=9C=20?= =?UTF-8?q?=EC=84=A0=ED=83=9D=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- WebContent/js/custom.js | 8 ++++++++ WebContent/jsp/js/custom.js | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/WebContent/js/custom.js b/WebContent/js/custom.js index e6bb511..c5e7c5f 100644 --- a/WebContent/js/custom.js +++ b/WebContent/js/custom.js @@ -36,6 +36,14 @@ // save the returnValue in options so that it is available in the callback function optns.returnValue = $frame[0].contentWindow.window.returnValue; optns.onClose(); + // Remove iframe from DOM so window.frames doesn't accumulate stale entries; + // without this, a second showModal call leaves frames[0] pointing to the first + // (closed) iframe, causing the previous returnValue to bleed into the next callback. + var $dialogEl = $frame.closest('.ui-dialog'); + setTimeout(function() { + $frame.remove(); + if ($dialogEl.length) $dialogEl.remove(); + }, 0); if(optns.option && optns.option.fullScreenPopup){ $('iframe[name=topFrame]',window.parent.document).css('display', 'block'); diff --git a/WebContent/jsp/js/custom.js b/WebContent/jsp/js/custom.js index 2cde935..5eda123 100644 --- a/WebContent/jsp/js/custom.js +++ b/WebContent/jsp/js/custom.js @@ -36,6 +36,14 @@ // save the returnValue in options so that it is available in the callback function optns.returnValue = $frame[0].contentWindow.window.returnValue; optns.onClose(); + // Remove iframe from DOM so window.frames doesn't accumulate stale entries; + // without this, a second showModal call leaves frames[0] pointing to the first + // (closed) iframe, causing the previous returnValue to bleed into the next callback. + var $dialogEl = $frame.closest('.ui-dialog'); + setTimeout(function() { + $frame.remove(); + if ($dialogEl.length) $dialogEl.remove(); + }, 0); if(optns.option && optns.option.fullScreenPopup){ $('iframe[name=topFrame]',window.parent.document).css('display', 'block');