From a16f5a123789883eb5fcb4002d2f26b3c460c7ef Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 21 Feb 2012 16:12:02 -0800 Subject: [PATCH] Use newer format for addPanel for nav items --- ui/scripts/ui/core.js | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/ui/scripts/ui/core.js b/ui/scripts/ui/core.js index b869f337bb1..1f39fcc0a28 100644 --- a/ui/scripts/ui/core.js +++ b/ui/scripts/ui/core.js @@ -53,7 +53,6 @@ * @param args CloudStack3 configuration */ var showSection = function(sectionID, args) { - var $panel; var $browser = $('#browser div.container'); var $navItem = $('#navigation').find('li').filter(function() { return $(this).hasClass(sectionID); @@ -66,25 +65,25 @@ // Reset browser panels $browser.cloudBrowser('removeAllPanels'); - $panel = $browser.cloudBrowser('addPanel', { + $browser.cloudBrowser('addPanel', { title: _l(data.title), - data: '' + data: '', + complete: function($panel) { + // Hide breadcrumb if this is the home section + if (args.home === sectionID) { + $('#breadcrumbs').find('li:first, div.end:last').hide(); + } + + // Append specified widget to view + if (data.show) + $panel.append(data.show(data)); + else if (data.treeView) + $panel.treeView(data, { context: args.context }); + else + $panel.listView(data, { context: args.context }); + } }); - // Hide breadcrumb if this is the home section - if (args.home === sectionID) { - $('#breadcrumbs').find('li:first, div.end:last').hide(); - } - - // Append specified widget to view - if (data.show) - $panel.append(data.show(data)); - else if (data.treeView) - $panel.treeView(data, { context: args.context }); - else - $panel.listView(data, { context: args.context }); - - return $navItem; };