zone page - after adding a host, expand cluster node to show host node.

This commit is contained in:
Jessica Wang 2010-12-29 19:10:02 -08:00
parent 466dff8757
commit b46b3918ef
2 changed files with 13 additions and 14 deletions

View File

@ -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();

View File

@ -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() {