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({
buttons: [
Ox.Button({
title: 'Manage Titles...'
}).bindEvent({
click: function() {
that.close();
(pandora.$ui.titlesDialog || (
pandora.$ui.titlesDialog = pandora.ui.titlesDialog()
)).open();
}
}),
{},
$findButton,
Ox.Button({
title: 'Done',
width: 48
}).bindEvent({
click: function() {
that.close();
}
})
],
closeButton: true,
content: Ox.SplitPanel({
elements: [
{
element: Ox.Bar({size: 24})
.append($status)
.append(
$findInput
),
size: 24
},
{
element: $list
}
buttons: [
Ox.Button({
title: 'Manage Titles...'
}).bindEvent({
click: function() {
that.close();
(pandora.$ui.titlesDialog || (
pandora.$ui.titlesDialog = pandora.ui.titlesDialog()
)).open();
}
}),
{},
$findButton,
Ox.Button({
title: 'Done',
width: 48
}).bindEvent({
click: function() {
that.close();
}
})
],
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>')
.css({
position: 'absolute',
top: '4px',
left: '128px',
right: '128px',
bottom: '4px',
paddingTop: '2px',
fontSize: '9px',
textAlign: 'center'
})
.appendTo(that.find('.OxButtonsbar'));
$status = $('<div>')
.css({
position: 'absolute',
top: '4px',
left: '128px',
right: '128px',
bottom: '4px',
paddingTop: '2px',
fontSize: '9px',
textAlign: 'center'
})
.appendTo(that.find('.OxButtonsbar'));
return that;

View file

@ -105,53 +105,64 @@ pandora.ui.titlesDialog = function() {
}),
that = Ox.Dialog({
buttons: [
Ox.Button({
title: 'Manage Names...'
}).bindEvent({
click: function() {
that.close();
(pandora.$ui.namesDialog || (
pandora.$ui.namesDialog = pandora.ui.namesDialog()
)).open();
}
}),
{},
$findButton,
Ox.Button({
title: 'Done',
width: 48
}).bindEvent({
click: function() {
that.close();
}
})
],
closeButton: true,
content: Ox.SplitPanel({
elements: [
{
element: Ox.Bar({size: 24})
.append($status)
.append(
$findInput
),
size: 24
},
{
element: $list
}
buttons: [
Ox.Button({
title: 'Manage Names...'
}).bindEvent({
click: function() {
that.close();
(pandora.$ui.namesDialog || (
pandora.$ui.namesDialog = pandora.ui.namesDialog()
)).open();
}
}),
{},
$findButton,
Ox.Button({
title: 'Done',
width: 48
}).bindEvent({
click: function() {
that.close();
}
})
],
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>')
.css({