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