fix switch between list and item

This commit is contained in:
rlx 2011-01-03 14:11:26 +00:00
parent a3d3ee9e56
commit 56f819da78

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,22 +2551,26 @@ var pandora = new Ox.App({
update: function() { update: function() {
URL.parse(); URL.parse();
if (app.user.ui.section == 'items') {
if (!old.user.ui.item) { if (!old.user.ui.item) {
if (!app.user.ui.item) { if (!app.user.ui.item) {
} else { } else {
//ui.toolbar.display(); app.$ui.mainPanel.replace(1, app.$ui.rightPanel = ui.rightPanel());
app.$ui.rightPanel.replace(0, app.$ui.toolbar = ui.toolbar()); //app.$ui.rightPanel.replace(0, app.$ui.toolbar = ui.toolbar());
ui.item().display(); //ui.item().display();
} }
} else { } else {
if (!app.user.ui.item) { 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 { } else {
app.$ui.contentPanel.replace(1, ui.item()); app.$ui.contentPanel.replace(1, ui.item());
} }
} }
} }
delete old.user.ui;
}
} }