diff --git a/ui/scripts/cloud.core.host.js b/ui/scripts/cloud.core.host.js index f31125ade95..60a3104d958 100644 --- a/ui/scripts/cloud.core.host.js +++ b/ui/scripts/cloud.core.host.js @@ -98,8 +98,8 @@ function hostJsonToDetailsTab() { if(jsonObj == null) return; - bindAddHostButton($("#add_host_button"), "host_page", $midmenuItem1); - bindAddPrimaryStorageButton($("#add_primarystorage_button"), "host_page", $midmenuItem1); + bindAddHostButton($midmenuItem1); + bindAddPrimaryStorageButton($midmenuItem1); $.ajax({ data: createURL("command=listHosts&id="+jsonObj.id), diff --git a/ui/scripts/cloud.core.pod.js b/ui/scripts/cloud.core.pod.js index 1ea814717ef..a342ee6c455 100644 --- a/ui/scripts/cloud.core.pod.js +++ b/ui/scripts/cloud.core.pod.js @@ -43,8 +43,8 @@ function podJsonToRightPanel($leftmenuItem1) { bindAddClusterButton($("#add_cluster_button"), "pod_page", $leftmenuItem1); - bindAddHostButton($("#add_host_button"), "pod_page", $leftmenuItem1); - bindAddPrimaryStorageButton($("#add_primarystorage_button"), "pod_page", $leftmenuItem1); + bindAddHostButton($leftmenuItem1); + bindAddPrimaryStorageButton($leftmenuItem1); $("#right_panel_content").data("$leftmenuItem1", $leftmenuItem1); $("#tab_details").click(); @@ -390,7 +390,8 @@ function bindAddClusterButton($button, currentPageInRightPanel, $leftmenuItem1) }); } -function bindAddHostButton($button, currentPageInRightPanel, $leftmenuItem1) { +function bindAddHostButton($leftmenuItem1) { + var $button = $("#add_host_button"); $button.unbind("click").bind("click", function(event) { dialogAddHost = $("#dialog_add_host"); dialogAddHost.find("#info_container").hide(); @@ -585,8 +586,8 @@ function clickClusterNodeAfterAddHost(clusterRadio, podId, newClusterName, exist } } -function bindAddPrimaryStorageButton($button, currentPageInRightPanel, $leftmenuItem1) { - $button.show(); +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(); diff --git a/ui/scripts/cloud.core.primarystorage.js b/ui/scripts/cloud.core.primarystorage.js index 0fb600c4aa4..f0ec2ba41be 100644 --- a/ui/scripts/cloud.core.primarystorage.js +++ b/ui/scripts/cloud.core.primarystorage.js @@ -59,8 +59,8 @@ function primarystorageJsonToDetailsTab() { if(jsonObj == null) return; - bindAddHostButton($("#add_host_button"), "primarystorage_page", $midmenuItem1); - bindAddPrimaryStorageButton($("#add_primarystorage_button"), "primarystorage_page", $midmenuItem1); + bindAddHostButton($midmenuItem1); + bindAddPrimaryStorageButton($midmenuItem1); $.ajax({ data: createURL("command=listStoragePools&id="+jsonObj.id),