From 7a9da982e3a9bb688e4ae23ce6fa7f6dd84f3cdc Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 12 Nov 2010 15:34:36 -0800 Subject: [PATCH] new UI - Resource page - Add Host shortcut dialog - when clicking Add Host button, expand the zone treenode that is selected in zone dropdown in dialog box. --- ui/scripts/cloud.core.resource.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/ui/scripts/cloud.core.resource.js b/ui/scripts/cloud.core.resource.js index 762bb0c8d50..4fe016be6ea 100644 --- a/ui/scripts/cloud.core.resource.js +++ b/ui/scripts/cloud.core.resource.js @@ -442,9 +442,8 @@ function initAddPodShortcut() { isValid &= validateString("Cluster Name", $thisDialog.find("#new_cluster_name"), $thisDialog.find("#new_cluster_name_errormsg")); } if (!isValid) - return; - - //$thisDialog.dialog("close"); //only close dialog when this action succeeds + return; + $thisDialog.find("#spinning_wheel").show() var array1 = []; @@ -452,6 +451,12 @@ function initAddPodShortcut() { var zoneId = $thisDialog.find("#zone_dropdown").val(); array1.push("&zoneid="+zoneId); + //expand zone in left menu tree (to show pod, cluster under the zone) ??? + var $zoneNode = $("#leftmenu_zone_tree").find("#tree_container").find("#zone_" + zoneId); + + if($zoneNode.find("#zone_arrow").hasClass("expanded_close")) + $zoneNode.find("#zone_arrow").click(); + var podId = $thisDialog.find("#pod_dropdown").val(); array1.push("&podid="+podId); @@ -513,8 +518,8 @@ function initAddPodShortcut() { clickClusterNodeAfterAddHost(clusterRadio, podId, newClusterName, existingClusterId, $thisDialog); }, error: function(XMLHttpResponse) { - handleError(XMLHttpResponse, function() { - clickClusterNodeAfterAddHost(clusterRadio, podId, newClusterName, existingClusterId, $thisDialog); + handleError(XMLHttpResponse, function() { + clickClusterNodeAfterAddHost(clusterRadio, podId, newClusterName, existingClusterId, $thisDialog); handleErrorInDialog(XMLHttpResponse, $thisDialog); }); }