From b46b3918ef5acd91507cf4f9adf8db0c4e8a50be Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 29 Dec 2010 19:10:02 -0800 Subject: [PATCH] zone page - after adding a host, expand cluster node to show host node. --- ui/scripts/cloud.core.pod.js | 20 ++++++++++---------- ui/scripts/cloud.core.zone.js | 7 +++---- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/ui/scripts/cloud.core.pod.js b/ui/scripts/cloud.core.pod.js index 6c814bf04a1..36cc00001b3 100644 --- a/ui/scripts/cloud.core.pod.js +++ b/ui/scripts/cloud.core.pod.js @@ -551,7 +551,7 @@ function bindAddHostButton($leftmenuItem1) { */ //clickClusterNodeAfterAddHost(clusterRadio, podId, newClusterName, existingClusterId, $thisDialog); - clickClusterArrowAfterAddHost(clusterRadio, podId, newClusterName, existingClusterId, $thisDialog); + expandClusterNodeAfterAddHost(clusterRadio, podId, newClusterName, existingClusterId, $thisDialog); //expand cluster node to see host node }, error: function(XMLHttpResponse) { handleError(XMLHttpResponse, function() { @@ -585,27 +585,27 @@ function clickClusterNodeAfterAddHost(clusterRadio, podId, newClusterName, exist } } -function clickClusterArrowAfterAddHost(clusterRadio, podId, newClusterName, existingClusterId, $thisDialog) { +//expand cluster node to see host node +function expandClusterNodeAfterAddHost(clusterRadio, podId, newClusterName, existingClusterId, $thisDialog) { if(clusterRadio == "new_cluster_radio") { //*** new cluster *** $thisDialog.find("#new_cluster_name").val(""); var $clusterNode = refreshClusterUnderPod($("#pod_" + podId), newClusterName, null, true); - $clusterNode.find("#cluster_arrow").click(); + var $arrow = $clusterNode.find("#cluster_arrow"); + if($arrow.hasClass("expanded_close")) + $arrow.click(); } else if(clusterRadio == "existing_cluster_radio") { //*** existing cluster *** if (existingClusterId != null && existingClusterId != '-1') { - $("#cluster_"+existingClusterId).find("#cluster_arrow").click(); + var $arrow = $("#cluster_"+existingClusterId).find("#cluster_arrow"); + if($arrow.hasClass("expanded_close")) + $arrow.click(); } } } function bindAddPrimaryStorageButton($leftmenuItem1) { var $button = $("#add_primarystorage_button"); - $button.unbind("click").bind("click", function(event) { - /* - if($("#tab_content_primarystorage").length > 0 && $("#tab_content_primarystorage").css("display") == "none") - $("#tab_primarystorage").click(); - */ - + $button.unbind("click").bind("click", function(event) { dialogAddPool = $("#dialog_add_pool"); dialogAddPool.find("#info_container").hide(); diff --git a/ui/scripts/cloud.core.zone.js b/ui/scripts/cloud.core.zone.js index 27e2fddd5aa..45ee8fc6981 100644 --- a/ui/scripts/cloud.core.zone.js +++ b/ui/scripts/cloud.core.zone.js @@ -1307,9 +1307,7 @@ function bindAddHostButtonOnZonePage($button, zoneId, zoneName) { success: function(json) { $thisDialog.find("#spinning_wheel").hide(); $thisDialog.dialog("close"); - - //showMiddleMenu(); - + /* var items = json.addhostresponse.host; var $midmenuItem1 = $("#midmenu_item").clone(); @@ -1327,7 +1325,8 @@ function bindAddHostButtonOnZonePage($button, zoneId, zoneName) { } */ - clickClusterNodeAfterAddHost(clusterRadio, podId, newClusterName, existingClusterId, $thisDialog); + //clickClusterNodeAfterAddHost(clusterRadio, podId, newClusterName, existingClusterId, $thisDialog); + expandClusterNodeAfterAddHost(clusterRadio, podId, newClusterName, existingClusterId, $thisDialog); //expand cluster node to see host node }, error: function(XMLHttpResponse) { handleError(XMLHttpResponse, function() {