From 87db844b6b68c60c42d2184980b12a6fc581d157 Mon Sep 17 00:00:00 2001 From: totoro Date: Thu, 5 Jun 2025 19:41:18 +0900 Subject: [PATCH] Destroy the previous dialog with same ID before creating a new one with that same id Maybe fix a long time bug. --- web/jQuery/jq_dialog.anubis | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/jQuery/jq_dialog.anubis b/web/jQuery/jq_dialog.anubis index 358d6e3..4e5644b 100644 --- a/web/jQuery/jq_dialog.anubis +++ b/web/jQuery/jq_dialog.anubis @@ -63,7 +63,11 @@ public define HTML_Partial_Content )= with dlg_id = id(dial_id), js_str = -" +"if($(\"#"+dlg_id+"\").dialog(\"instance\")) { + // Dialog exists, destroy it + console.log('jq_dialog_create : #"+dlg_id+" dialog id already exists. Hence destroy it'); + $(\"#"+dlg_id+"\").dialog(\"destroy\"); + }; $( \"#"+dlg_id+"\" ).dialog({ autoOpen: "+to_String(autoOpen)+", modal: true, -- libgit2 0.21.4