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

This commit is contained in:
rlx 2011-01-04 00:18:36 +00:00
parent 4b591eeaac
commit 4d7374a59a

View file

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