fix switch between list and item

This commit is contained in:
rolux 2011-01-03 14:11:26 +00:00
parent 1979f4d418
commit 821934dc8a

View file

@ -1093,7 +1093,6 @@ var pandora = new Ox.App({
list: function(view) {
var that, $map,
keys = ['director', 'id', 'poster', 'title', 'year'];
app.user.ui.mode = 'list';
Ox.print('constructList', view);
if (view == 'list') {
that = new Ox.TextList({
@ -2288,7 +2287,7 @@ var pandora = new Ox.App({
callback(value);
}
function getAlignment(key) {
function getAlignment(key) { // fixme: make static
return ['person', 'string', 'text', 'title'].indexOf(
Ox.getObjectById(app.config.sortKeys, key).type
) > -1 ? 'left' : 'right';
@ -2301,7 +2300,7 @@ var pandora = new Ox.App({
return width;
}
function getSortOperator(key) {
function getSortOperator(key) { // fixme: make static
return ['person', 'string', 'text', 'title'].indexOf(
Ox.getObjectById(app.config.sortKeys, key).type
) > -1 ? '' : '-';
@ -2552,22 +2551,26 @@ var pandora = new Ox.App({
update: function() {
URL.parse();
if (app.user.ui.section == 'items') {
if (!old.user.ui.item) {
if (!app.user.ui.item) {
} else {
//ui.toolbar.display();
app.$ui.rightPanel.replace(0, app.$ui.toolbar = ui.toolbar());
ui.item().display();
app.$ui.mainPanel.replace(1, app.$ui.rightPanel = ui.rightPanel());
//app.$ui.rightPanel.replace(0, app.$ui.toolbar = ui.toolbar());
//ui.item().display();
}
} else {
if (!app.user.ui.item) {
ui.list(app.user.ui.listView).display();
app.$ui.mainPanel.replace(1, app.$ui.rightPanel = ui.rightPanel());
//ui.list(app.user.ui.listView).display();
} else {
app.$ui.contentPanel.replace(1, ui.item());
}
}
}
delete old.user.ui;
}
}