new UI - zone tree - make whole pod row and whole cluster row clickable (before this change, only pod name and cluster name were clickable).

This commit is contained in:
Jessica Wang 2010-11-29 15:04:21 -08:00
parent 96153b00b2
commit f63409029a
2 changed files with 39 additions and 16 deletions

View File

@ -956,7 +956,7 @@ long milliseconds = new Date().getTime();
<p> Adding Pod &hellip; </p>
</div>
<div id="row_container">
<div class="leftmenu_content" id="header">
<div id="pod_header" class="leftmenu_content">
<div class="leftmenu_fourthindent">
<div class="leftmenu_arrows white_nonexpanded_close" id="pod_arrow">
</div>
@ -978,7 +978,7 @@ long milliseconds = new Date().getTime();
<p> Adding Cluster &hellip; </p>
</div>
<div id="row_container">
<div class="leftmenu_content" id="header">
<div id="cluster_header" class="leftmenu_content">
<div class="leftmenu_fifthindent">
<div class="leftmenu_arrows white_nonexpanded_close" id="cluster_arrow">
</div>
@ -986,12 +986,6 @@ long milliseconds = new Date().getTime();
<span id="cluster_name"></span>
</div>
</div>
<div id="cluster_content">
<div id="hosts_container">
</div>
<div id="primarystorages_container">
</div>
</div>
</div>
</div>
<!-- Cluster Template (end) -->

View File

@ -112,20 +112,49 @@ function buildZoneTree() {
selectRowInZoneTree(target.parent().parent());
var $leftmenuItem1 = target.parent().parent().parent().parent();
resourceLoadPage("jsp/pod.jsp", $leftmenuItem1);
break;
case "cluster_name_label" :
case "cluster_name" :
selectRowInZoneTree(target.parent().parent());
var $leftmenuItem1 = target.parent().parent().parent().parent();
resourceLoadPage("jsp/cluster.jsp", $leftmenuItem1);
break;
break;
default:
break;
}
return false;
});
$("#leftmenu_pod_node_template").unbind("click").bind("click", function(event) {
var $podNode = $(this);
var target = $(event.target);
var action = target.attr("id");
var id = $podNode.data("id");
var name = $podNode.data("name");
switch (action) {
case "pod_arrow" :
var podObj = $podNode.data("jsonObj");
var $podContent = $podNode.find("#pod_content");
if(target.hasClass("expanded_close")) {
target.removeClass("expanded_close").addClass("expanded_open");
$podContent.show();
refreshClusterUnderPod($podNode);
}
else if(target.hasClass("expanded_open")) {
target.removeClass("expanded_open").addClass("expanded_close");
$podContent.hide();
$podContent.find("#clusters_container").empty();
}
break;
default:
selectRowInZoneTree($(this).find("#pod_head"));
resourceLoadPage("jsp/pod.jsp", $(this));
break;
}
return false;
});
$("#leftmenu_cluster_node_template").unbind("click").bind("click", function(event) {
selectRowInZoneTree($(this).find("#cluster_head"));
resourceLoadPage("jsp/cluster.jsp", $(this));
return false;
});
}
function refreshClusterUnderPod($podNode, newClusterName, existingClusterId, noClicking) {