fix for a bug where, when collapsing the sidebar and then swapping groups, their column widths would be wrong

This commit is contained in:
rolux 2011-01-04 00:18:36 +00:00
parent 2608213f1d
commit 786ca6596e

View file

@ -779,7 +779,7 @@ var pandora = new Ox.App({
*/
//alert(id + ' ' + JSON.stringify(Query.toObject(id)))
var i = app.user.ui.groups.indexOf(id),
panelWidth = app.$ui.document.width() - app.user.ui.listsSize - 1,
panelWidth = app.$ui.document.width() - (app.user.ui.showSidebar * app.user.ui.sidebarSize) - 1,
title = Ox.getObjectById(app.config.groups, id).title,
width = getGroupWidth(i, panelWidth),
that = new Ox.TextList({
@ -1074,13 +1074,15 @@ var pandora = new Ox.App({
element: app.$ui.info = ui.info().options({
id: 'infoPanel'
}),
size: app.user.ui.listsSize / app.ui.infoRatio + 16
size: app.user.ui.sidebarSize / app.ui.infoRatio + 16
}
],
id: 'leftPanel',
orientation: 'vertical'
})
.bindEvent('resize', function(event, data) {
.bindEvent({
resize: function(event, data) {
app.user.ui.sidebarSize = data;
if (data < app.ui.sectionButtonsWidth && app.$ui.sectionButtons) {
app.$ui.sectionButtons.remove();
delete app.$ui.sectionButtons;
@ -1092,6 +1094,10 @@ var pandora = new Ox.App({
}
Ox.print('resize', data, data / app.ui.infoRatio + 16);
app.$ui.leftPanel.size('infoPanel', Math.round(data / app.ui.infoRatio) + 16);
},
toggle: function(event, data) {
app.user.ui.showSidebar = !data.collapsed;
}
});
return that;
},
@ -2006,7 +2012,7 @@ var pandora = new Ox.App({
element: app.$ui.leftPanel = ui.leftPanel(),
resizable: true,
resize: [128, 256, 384, 512],
size: app.user.ui.listsSize
size: app.user.ui.sidebarSize
},
{
element: app.$ui.rightPanel = ui.rightPanel()