fix #945 (list doesn't react to manage titles/names dialog resize)

This commit is contained in:
rolux 2012-09-15 12:14:12 +00:00
parent 148912ab37
commit 1364737d09
2 changed files with 124 additions and 102 deletions

View file

@ -116,66 +116,77 @@ pandora.ui.namesDialog = function() {
}), }),
that = Ox.Dialog({ that = Ox.Dialog({
buttons: [ buttons: [
Ox.Button({ Ox.Button({
title: 'Manage Titles...' title: 'Manage Titles...'
}).bindEvent({ }).bindEvent({
click: function() { click: function() {
that.close(); that.close();
(pandora.$ui.titlesDialog || ( (pandora.$ui.titlesDialog || (
pandora.$ui.titlesDialog = pandora.ui.titlesDialog() pandora.$ui.titlesDialog = pandora.ui.titlesDialog()
)).open(); )).open();
} }
}), }),
{}, {},
$findButton, $findButton,
Ox.Button({ Ox.Button({
title: 'Done', title: 'Done',
width: 48 width: 48
}).bindEvent({ }).bindEvent({
click: function() { click: function() {
that.close(); that.close();
} }
}) })
],
closeButton: true,
content: Ox.SplitPanel({
elements: [
{
element: Ox.Bar({size: 24})
.append($status)
.append(
$findInput
),
size: 24
},
{
element: $list
}
], ],
orientation: 'vertical' closeButton: true,
content: Ox.SplitPanel({
elements: [
{
element: Ox.Bar({size: 24})
.append($status)
.append(
$findInput
),
size: 24
},
{
element: $list
}
],
orientation: 'vertical'
}),
height: height,
maximizeButton: true,
minHeight: 256,
minWidth: 512,
padding: 0,
title: 'Manage Names',
width: width
})
.bindEvent({
resizeend: function(data) {
var width = (data.width - 64 - Ox.UI.SCROLLBAR_SIZE) / 2;
[
{id: 'name', width: Math.ceil(width)},
{id: 'sortname', width: Math.floor(width)}
].forEach(function(column) {
$list.resizeColumn(column.id, column.width);
});
}
}), }),
height: height,
maximizeButton: true,
minHeight: 256,
minWidth: 512,
padding: 0,
title: 'Manage Names',
width: width
}),
$status = $('<div>') $status = $('<div>')
.css({ .css({
position: 'absolute', position: 'absolute',
top: '4px', top: '4px',
left: '128px', left: '128px',
right: '128px', right: '128px',
bottom: '4px', bottom: '4px',
paddingTop: '2px', paddingTop: '2px',
fontSize: '9px', fontSize: '9px',
textAlign: 'center' textAlign: 'center'
}) })
.appendTo(that.find('.OxButtonsbar')); .appendTo(that.find('.OxButtonsbar'));
return that; return that;

View file

@ -105,53 +105,64 @@ pandora.ui.titlesDialog = function() {
}), }),
that = Ox.Dialog({ that = Ox.Dialog({
buttons: [ buttons: [
Ox.Button({ Ox.Button({
title: 'Manage Names...' title: 'Manage Names...'
}).bindEvent({ }).bindEvent({
click: function() { click: function() {
that.close(); that.close();
(pandora.$ui.namesDialog || ( (pandora.$ui.namesDialog || (
pandora.$ui.namesDialog = pandora.ui.namesDialog() pandora.$ui.namesDialog = pandora.ui.namesDialog()
)).open(); )).open();
} }
}), }),
{}, {},
$findButton, $findButton,
Ox.Button({ Ox.Button({
title: 'Done', title: 'Done',
width: 48 width: 48
}).bindEvent({ }).bindEvent({
click: function() { click: function() {
that.close(); that.close();
} }
}) })
],
closeButton: true,
content: Ox.SplitPanel({
elements: [
{
element: Ox.Bar({size: 24})
.append($status)
.append(
$findInput
),
size: 24
},
{
element: $list
}
], ],
orientation: 'vertical' closeButton: true,
content: Ox.SplitPanel({
elements: [
{
element: Ox.Bar({size: 24})
.append($status)
.append(
$findInput
),
size: 24
},
{
element: $list
}
],
orientation: 'vertical'
}),
height: height,
maximizeButton: true,
minHeight: 256,
minWidth: 512,
padding: 0,
title: 'Manage Titles',
width: width
})
.bindEvent({
resizeend: function(data) {
var width = (data.width - Ox.UI.SCROLLBAR_SIZE) / 2;
[
{id: 'title', width: Math.ceil(width)},
{id: 'sorttitle', width: Math.floor(width)}
].forEach(function(column) {
$list.resizeColumn(column.id, column.width);
});
}
}), }),
height: height,
maximizeButton: true,
minHeight: 256,
minWidth: 512,
padding: 0,
title: 'Manage Titles',
width: width
}),
$status = $('<div>') $status = $('<div>')
.css({ .css({