|
53 | 53 | * @param args CloudStack3 configuration |
54 | 54 | */ |
55 | 55 | var showSection = function(sectionID, args) { |
56 | | - var $panel; |
57 | 56 | var $browser = $('#browser div.container'); |
58 | 57 | var $navItem = $('#navigation').find('li').filter(function() { |
59 | 58 | return $(this).hasClass(sectionID); |
|
66 | 65 |
|
67 | 66 | // Reset browser panels |
68 | 67 | $browser.cloudBrowser('removeAllPanels'); |
69 | | - $panel = $browser.cloudBrowser('addPanel', { |
| 68 | + $browser.cloudBrowser('addPanel', { |
70 | 69 | 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 | + } |
86 | 76 |
|
| 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 | + }); |
87 | 86 |
|
88 | 87 | return $navItem; |
89 | 88 | }; |
|
0 commit comments