split up pandora.js
This commit is contained in:
parent
565b5d35c7
commit
6073a1cd19
41 changed files with 4508 additions and 3931 deletions
53
static/js/pandora/ui/leftPanel.js
Normal file
53
static/js/pandora/ui/leftPanel.js
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
// vim: et:ts=4:sw=4:sts=4:ft=js
|
||||
pandora.ui.leftPanel = function() {
|
||||
var that = new Ox.SplitPanel({
|
||||
elements: [
|
||||
{
|
||||
element: app.$ui.sectionbar = pandora.ui.sectionbar('buttons'),
|
||||
size: 24
|
||||
},
|
||||
{
|
||||
element: app.$ui.folders = pandora.ui.folders()
|
||||
},
|
||||
{
|
||||
collapsed: !app.user.ui.showInfo,
|
||||
collapsible: true,
|
||||
element: app.$ui.info = pandora.ui.info(),
|
||||
size: app.user.ui.sidebarSize / app.ui.infoRatio + 16
|
||||
}
|
||||
],
|
||||
id: 'leftPanel',
|
||||
orientation: 'vertical'
|
||||
})
|
||||
.bindEvent({
|
||||
resize: function(event, data) {
|
||||
var infoSize = Math.round(data / app.ui.infoRatio) + 16;
|
||||
app.user.ui.sidebarSize = data;
|
||||
if (data < app.ui.sectionButtonsWidth && app.$ui.sectionButtons) {
|
||||
app.$ui.sectionButtons.removeElement();
|
||||
delete app.$ui.sectionButtons;
|
||||
app.$ui.sectionbar.append(app.$ui.sectionSelect = pandora.ui.sectionSelect());
|
||||
} else if (data >= app.ui.sectionButtonsWidth && app.$ui.sectionSelect) {
|
||||
app.$ui.sectionSelect.removeElement();
|
||||
delete app.$ui.sectionSelect;
|
||||
app.$ui.sectionbar.append(app.$ui.sectionButtons = pandora.ui.sectionButtons());
|
||||
}
|
||||
!app.user.ui.showInfo && app.$ui.leftPanel.css({bottom: -infoSize});
|
||||
app.$ui.leftPanel.size(2, infoSize);
|
||||
pandora.resizeFolders();
|
||||
},
|
||||
resizeend: function(event, data) {
|
||||
pandora.UI.set({sidebarSize: data});
|
||||
},
|
||||
toggle: function(event, data) {
|
||||
pandora.UI.set({showSidebar: !data.collapsed});
|
||||
if (data.collapsed) {
|
||||
$.each(app.$ui.folderList, function(k, $list) {
|
||||
$list.loseFocus();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
return that;
|
||||
};
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue