From 2e645d18cf8694441dbd45767ad4d1e39b602c1b Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 10 May 2011 14:34:56 -0700 Subject: [PATCH] bug 9795: Copy Template Dialog, Copy ISO Dialog - fix a bug that entries in zone dropdown are duplicated when the dialog pops up the 2nd time. --- ui/scripts/cloud.core.iso.js | 3 ++- ui/scripts/cloud.core.template.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/scripts/cloud.core.iso.js b/ui/scripts/cloud.core.iso.js index b03efa4d134..d7038ec50a2 100644 --- a/ui/scripts/cloud.core.iso.js +++ b/ui/scripts/cloud.core.iso.js @@ -109,7 +109,8 @@ function initAddIsoDialog() { $.ajax({ data: createURL("command=listZones&available=true"), dataType: "json", - success: function(json) { + success: function(json) { + g_zoneIds = []; var zones = json.listzonesresponse.zone; if (zones != null && zones.length > 0) { for (var i = 0; i < zones.length; i++) { diff --git a/ui/scripts/cloud.core.template.js b/ui/scripts/cloud.core.template.js index 9206cbbf7b9..f93146daf58 100644 --- a/ui/scripts/cloud.core.template.js +++ b/ui/scripts/cloud.core.template.js @@ -217,7 +217,8 @@ function afterLoadTemplateJSP() { $.ajax({ data: createURL("command=listZones&available=true"), dataType: "json", - success: function(json) { + success: function(json) { + g_zoneIds = []; var zones = json.listzonesresponse.zone; if (zones != null && zones.length > 0) { for (var i = 0; i < zones.length; i++) {