pandora/static/js/pandora/ui/rightPanel.js

63 lines
2.3 KiB
JavaScript
Raw Normal View History

2011-07-29 18:37:11 +00:00
// vim: et:ts=4:sw=4:sts=4:ft=javascript
2011-05-25 19:42:45 +00:00
pandora.ui.rightPanel = function() {
var that;
2011-06-06 15:48:11 +00:00
if (pandora.user.ui.section == 'site') {
2011-06-06 15:55:37 +00:00
if (pandora.user.ui.sitePage == 'home') {
2011-06-04 04:37:05 +00:00
that = pandora.ui.homePage()
.bindEvent({
resize: function(data) {
that.resize();
}
});
} else {
2011-06-19 17:49:25 +00:00
that = Ox.Element()
2011-06-04 04:37:05 +00:00
.css({padding: '8px'});
2011-06-06 15:48:11 +00:00
pandora.api.getPage(pandora.user.ui.sitePage, function(result) {
2011-06-04 04:37:05 +00:00
that.html(result.data.body).css({overflowY: 'auto'});
2011-05-25 19:42:45 +00:00
});
2011-06-04 04:37:05 +00:00
}
2011-06-06 15:48:11 +00:00
} else if (pandora.user.ui.section == 'items') {
2011-06-19 17:49:25 +00:00
that = Ox.SplitPanel({
2011-05-25 19:42:45 +00:00
elements: [
{
2011-06-06 15:48:11 +00:00
element: pandora.$ui.toolbar = pandora.ui.toolbar(),
2011-05-25 19:42:45 +00:00
size: 24
},
{
2011-06-06 15:48:11 +00:00
element: pandora.$ui.contentPanel = pandora.ui.contentPanel()
2011-05-25 19:42:45 +00:00
},
{
2011-06-06 15:48:11 +00:00
element: pandora.$ui.statusbar = pandora.ui.statusbar(),
2011-05-25 19:42:45 +00:00
size: 16
}
],
id: 'rightPanel',
orientation: 'vertical'
})
.bindEvent({
resize: function(event, data) {
//Ox.print('???? resize rightPanel', event, data)
2011-06-06 15:48:11 +00:00
if (!pandora.user.ui.item) {
2011-05-25 21:31:47 +00:00
pandora.resizeGroups(data);
2011-06-06 15:48:11 +00:00
pandora.$ui.list.size();
if (pandora.user.ui.lists[pandora.user.ui.list].listView == 'map') {
pandora.$ui.map.resizeMap();
2011-05-25 19:42:45 +00:00
}
} else {
2011-06-06 15:48:11 +00:00
pandora.$ui.browser.scrollToSelection();
pandora.user.ui.itemView == 'player' && pandora.$ui.player.options({
2011-05-25 19:42:45 +00:00
width: data
});
2011-06-06 15:48:11 +00:00
pandora.user.ui.itemView == 'timeline' && pandora.$ui.editor.options({
2011-05-25 19:42:45 +00:00
width: data
});
2011-06-07 03:17:36 +00:00
pandora.user.ui.itemView == 'frames' && pandora.$ui.item.resize();
pandora.user.ui.itemView == 'posters' && pandora.$ui.item.resize();
2011-05-25 19:42:45 +00:00
}
}
});
}
return that;
};