From 73194c2484d701da7165aa6bc3dedf09768ff89a Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 29 Dec 2010 12:34:37 -0800 Subject: [PATCH] bug 7701: optimize bindAddClusterButton(). --- ui/scripts/cloud.core.pod.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/scripts/cloud.core.pod.js b/ui/scripts/cloud.core.pod.js index a342ee6c455..45fe4cdc7e5 100644 --- a/ui/scripts/cloud.core.pod.js +++ b/ui/scripts/cloud.core.pod.js @@ -42,7 +42,7 @@ } function podJsonToRightPanel($leftmenuItem1) { - bindAddClusterButton($("#add_cluster_button"), "pod_page", $leftmenuItem1); + bindAddClusterButton($leftmenuItem1); bindAddHostButton($leftmenuItem1); bindAddPrimaryStorageButton($leftmenuItem1); @@ -274,14 +274,14 @@ function refreshClsuterFieldInAddHostDialog(dialogAddHost, podId, clusterId, hyp }); } -function bindAddClusterButton($button, currentPageInRightPanel, $leftmenuItem1) { - $button.show(); +function bindAddClusterButton($leftmenuItem1) { + var $button = $("#add_cluster_button"); $button.unbind("click").bind("click", function(event) { dialogAddCluster = $("#dialog_add_external_cluster"); dialogAddCluster.find("#info_container").hide(); var zoneId, podId; - if(currentPageInRightPanel == "pod_page") { + if(currentRightPanelJSP == "jsp/pod.jsp") { var podObj = $leftmenuItem1.data("jsonObj"); zoneId = podObj.zoneid; podId = podObj.id;