From a73b9dd7fbba2baed2ebf4366df484dfab1bf81b Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 29 Dec 2010 21:00:55 -0800 Subject: [PATCH] cluster page - Add Host dialog - fix a bug that Join cluster field didn't have right default value (default value should be the cluster that's currently on) --- ui/scripts/cloud.core.pod.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ui/scripts/cloud.core.pod.js b/ui/scripts/cloud.core.pod.js index becf520b9a3..1c93c62b04e 100644 --- a/ui/scripts/cloud.core.pod.js +++ b/ui/scripts/cloud.core.pod.js @@ -429,9 +429,7 @@ function bindAddHostButton($leftmenuItem1) { dialogAddHost.find("#zone_name").text(fromdb(primarystorageObj.zonename)); dialogAddHost.find("#pod_name").text(fromdb(primarystorageObj.podname)); } - - refreshClsuterFieldInAddHostDialog(dialogAddHost, podId, clusterId, dialogAddHost.find("#host_hypervisor").val()); - + dialogAddHost.find("#host_hypervisor").change(function() { if($(this).val() == "VmWare") { $('li[input_group="vmware"]', dialogAddHost).show(); @@ -441,7 +439,7 @@ function bindAddHostButton($leftmenuItem1) { $('li[input_group="general"]', dialogAddHost).show(); } - refreshClsuterFieldInAddHostDialog(dialogAddHost, podId, null, $(this).val()); + refreshClsuterFieldInAddHostDialog(dialogAddHost, podId, clusterId, $(this).val()); }).change(); dialogAddHost @@ -555,7 +553,7 @@ function bindAddHostButton($leftmenuItem1) { }, error: function(XMLHttpResponse) { handleError(XMLHttpResponse, function() { - refreshClsuterFieldInAddHostDialog($thisDialog, podId, null, dialogAddHost.find("#host_hypervisor").val()); + refreshClsuterFieldInAddHostDialog($thisDialog, podId, clusterId, dialogAddHost.find("#host_hypervisor").val()); handleErrorInDialog(XMLHttpResponse, $thisDialog); if(clusterRadio == "new_cluster_radio") { //*** new cluster *** refreshClusterUnderPod($("#pod_" + podId), newClusterName, null, true); //refresh clusters under pod, but no clicking at any cluster