diff --git a/ui/scripts/cloud.core.init.js b/ui/scripts/cloud.core.init.js index cf4e404eaf4..3ca81239bf7 100644 --- a/ui/scripts/cloud.core.init.js +++ b/ui/scripts/cloud.core.init.js @@ -55,7 +55,7 @@ $(document).ready(function() { }); $("#leftmenu_account").bind("click", function(event) { if (selectLeftMenu($(this))) { - listMidMenuItems("listAccounts", "listaccountsresponse", "account", "jsp/account.jsp", afterLoadAccountJSP, accountToMidmenu, accountToRightPanel, getMidmenuId, false); + listMidMenuItems("listAccounts", "listaccountsresponse", "account", "jsp/account.jsp", afterLoadAccountJSP, accountToMidmenu, accountToRightPanel, getMidmenuId, false, "leftmenu_account"); } return false; }); @@ -192,6 +192,14 @@ $(document).ready(function() { return; } + // refresh button + $("#refresh_link").bind("click", function(event) { + var leftmenuId = $("#right_panel").data("leftmenuId"); + if(leftmenuId != null && leftmenuId.length > 0) + $("#"+leftmenuId).click(); + return false; + }); + // Initialize help drop down dialog $("#help_link").bind("click", function(event) { $("#help_dropdown_dialog").show(); diff --git a/ui/scripts/cloud.core.js b/ui/scripts/cloud.core.js index dd6f8d00465..bec54e9a77c 100644 --- a/ui/scripts/cloud.core.js +++ b/ui/scripts/cloud.core.js @@ -975,12 +975,14 @@ function listMidMenuItems2(commandString, jsonResponse1, jsonResponse2, toMidmen return count; } -function listMidMenuItems(commandString, jsonResponse1, jsonResponse2, rightPanelJSP, afterLoadRightPanelJSPFn, toMidmenuFn, toRightPanelFn, getMidmenuIdFn, isMultipleSelectionInMidMenu) { +function listMidMenuItems(commandString, jsonResponse1, jsonResponse2, rightPanelJSP, afterLoadRightPanelJSPFn, toMidmenuFn, toRightPanelFn, getMidmenuIdFn, isMultipleSelectionInMidMenu, leftmenuId) { clearMiddleMenu(); showMiddleMenu(); $("#midmenu_container").hide(); $("#midmenu_spinning_wheel").show(); + $("#right_panel").data("leftmenuId", leftmenuId); + $("#right_panel").load(rightPanelJSP, function(){ var $actionLink = $("#right_panel_content #tab_content_details #action_link"); $actionLink.bind("mouseover", function(event) { @@ -1001,7 +1003,7 @@ function listMidMenuItems(commandString, jsonResponse1, jsonResponse2, rightPane function bindAndListMidMenuItems($leftmenu, commandString, jsonResponse1, jsonResponse2, rightPanelJSP, afterLoadRightPanelJSPFn, toMidmenuFn, toRightPanelFn, getMidmenuIdFn, isMultipleSelectionInMidMenu) { $leftmenu.bind("click", function(event) { selectLeftSubMenu($(this)); - listMidMenuItems(commandString, jsonResponse1, jsonResponse2, rightPanelJSP, afterLoadRightPanelJSPFn, toMidmenuFn, toRightPanelFn, getMidmenuIdFn, isMultipleSelectionInMidMenu); + listMidMenuItems(commandString, jsonResponse1, jsonResponse2, rightPanelJSP, afterLoadRightPanelJSPFn, toMidmenuFn, toRightPanelFn, getMidmenuIdFn, isMultipleSelectionInMidMenu, $(this).attr("id")); return false; }); }