Commit 87db844b6b68c60c42d2184980b12a6fc581d157
1 parent
04a1561e
Destroy the previous dialog with same ID before creating a new one with that same id
Maybe fix a long time bug.
Showing
1 changed file
with
5 additions
and
1 deletions
Show diff stats
web/jQuery/jq_dialog.anubis
| ... | ... | @@ -63,7 +63,11 @@ public define HTML_Partial_Content |
| 63 | 63 | )= |
| 64 | 64 | with dlg_id = id(dial_id), |
| 65 | 65 | js_str = |
| 66 | -" | |
| 66 | +"if($(\"#"+dlg_id+"\").dialog(\"instance\")) { | |
| 67 | + // Dialog exists, destroy it | |
| 68 | + console.log('jq_dialog_create : #"+dlg_id+" dialog id already exists. Hence destroy it'); | |
| 69 | + $(\"#"+dlg_id+"\").dialog(\"destroy\"); | |
| 70 | + }; | |
| 67 | 71 | $( \"#"+dlg_id+"\" ).dialog({ |
| 68 | 72 | autoOpen: "+to_String(autoOpen)+", |
| 69 | 73 | modal: true, | ... | ... |