From 28e338ff7eff6583f3188f5594c83b2248b14e60 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Mon, 29 Nov 2010 11:54:06 -0800 Subject: [PATCH] Refresh button - implement refresh button on instance page, volume page, snapshot page, IP address page, template page, ISO page, account page, event page, alert page, virtual router page, system VM page, disk offering page, service offering page. --- ui/scripts/cloud.core.init.js | 10 +++++++++- ui/scripts/cloud.core.js | 6 ++++-- 2 files changed, 13 insertions(+), 3 deletions(-) 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; }); }