Skip to content

Commit a16f5a1

Browse files
committed
Use newer format for addPanel for nav items
1 parent c71f22c commit a16f5a1

1 file changed

Lines changed: 16 additions & 17 deletions

File tree

ui/scripts/ui/core.js

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
* @param args CloudStack3 configuration
5454
*/
5555
var showSection = function(sectionID, args) {
56-
var $panel;
5756
var $browser = $('#browser div.container');
5857
var $navItem = $('#navigation').find('li').filter(function() {
5958
return $(this).hasClass(sectionID);
@@ -66,24 +65,24 @@
6665

6766
// Reset browser panels
6867
$browser.cloudBrowser('removeAllPanels');
69-
$panel = $browser.cloudBrowser('addPanel', {
68+
$browser.cloudBrowser('addPanel', {
7069
title: _l(data.title),
71-
data: ''
72-
});
73-
74-
// Hide breadcrumb if this is the home section
75-
if (args.home === sectionID) {
76-
$('#breadcrumbs').find('li:first, div.end:last').hide();
77-
}
78-
79-
// Append specified widget to view
80-
if (data.show)
81-
$panel.append(data.show(data));
82-
else if (data.treeView)
83-
$panel.treeView(data, { context: args.context });
84-
else
85-
$panel.listView(data, { context: args.context });
70+
data: '',
71+
complete: function($panel) {
72+
// Hide breadcrumb if this is the home section
73+
if (args.home === sectionID) {
74+
$('#breadcrumbs').find('li:first, div.end:last').hide();
75+
}
8676

77+
// Append specified widget to view
78+
if (data.show)
79+
$panel.append(data.show(data));
80+
else if (data.treeView)
81+
$panel.treeView(data, { context: args.context });
82+
else
83+
$panel.listView(data, { context: args.context });
84+
}
85+
});
8786

8887
return $navItem;
8988
};

0 commit comments

Comments
 (0)