From a684b3af25e255ae70cdca3807df539b863dcf7d Mon Sep 17 00:00:00 2001 From: Pranav Saxena Date: Thu, 13 Sep 2012 16:16:36 +0530 Subject: [PATCH] CS-16328:UI not calling the listCapacity correctly Reviewed-By:Brian --- ui/scripts/dashboard.js | 17 ++++++++++++++++- ui/scripts/ui-custom/dashboard.js | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ui/scripts/dashboard.js b/ui/scripts/dashboard.js index 7a7df08c4df..c06b73cf68d 100644 --- a/ui/scripts/dashboard.js +++ b/ui/scripts/dashboard.js @@ -135,10 +135,25 @@ }); }, capacity: function(data) { + var latestData =null; + if(window.fetchLatestflag == 1) + { + latestData = { + fetchLatest:true + } + } + else + { + latestData = { + fetchLatest:false + } + } + window.fetchLatestflag = 0; + if (data.zones) { $.ajax({ url: createURL('listCapacity'), - data: { fetchLatest: true }, + data: latestData, success: function(json) { var capacities = json.listcapacityresponse.capacity; diff --git a/ui/scripts/ui-custom/dashboard.js b/ui/scripts/ui-custom/dashboard.js index 4b53eb0a0e0..cc804c3ea10 100644 --- a/ui/scripts/ui-custom/dashboard.js +++ b/ui/scripts/ui-custom/dashboard.js @@ -175,6 +175,7 @@ //Fetch Latest action $dashboard.find('.fetch-latest').click(function() { + window.fetchLatestflag = 1; var $browser = $('#browser .container'); if ($(this).hasClass('fetch-latest')) $('#navigation li.dashboard').click();