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

61 lines
2 KiB
JavaScript
Raw Normal View History

2011-05-25 19:42:45 +00:00
// vim: et:ts=4:sw=4:sts=4:ft=js
pandora.ui.rightPanel = function() {
var that;
if (app.user.ui.section == 'site') {
2011-06-04 04:37:05 +00:00
if (app.user.ui.sitePage == 'home') {
that = pandora.ui.homePage()
.bindEvent({
resize: function(data) {
that.resize();
}
});
} else {
that = new Ox.Element()
.css({padding: '8px'});
2011-05-25 19:42:45 +00:00
pandora.api.getPage(app.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-05-25 19:42:45 +00:00
} else if (app.user.ui.section == 'items') {
that = new Ox.SplitPanel({
elements: [
{
element: app.$ui.toolbar = pandora.ui.toolbar(),
size: 24
},
{
element: app.$ui.contentPanel = pandora.ui.contentPanel()
},
{
element: app.$ui.statusbar = pandora.ui.statusbar(),
size: 16
}
],
id: 'rightPanel',
orientation: 'vertical'
})
.bindEvent({
resize: function(event, data) {
//Ox.print('???? resize rightPanel', event, data)
if (!app.user.ui.item) {
2011-05-25 21:31:47 +00:00
pandora.resizeGroups(data);
2011-05-25 19:42:45 +00:00
app.$ui.list.size();
if (app.user.ui.lists[app.user.ui.list].listView == 'map') {
2011-06-02 18:23:24 +00:00
app.$ui.map.resizeMap();
2011-05-25 19:42:45 +00:00
}
} else {
app.$ui.browser.scrollToSelection();
app.user.ui.itemView == 'player' && app.$ui.player.options({
width: data
});
app.user.ui.itemView == 'timeline' && app.$ui.editor.options({
width: data
});
}
}
});
}
return that;
};