more thorough fix for missing list preferences

This commit is contained in:
rlx 2011-08-16 14:19:37 +00:00
parent 3e4a978738
commit b5dc63f150
4 changed files with 11 additions and 10 deletions

View file

@ -89,6 +89,9 @@ Ox.load('Geo', function() {
sectionElement: 'buttons',
selectedMovies: []
});
// fixme: this should not happen
!pandora.user.ui.lists[pandora.user.ui.list]
&& pandora.user.ui.lists[pandora.user.ui.list] = pandora.user.ui.lists[''];
if (data.user.level == 'guest' && $.browser.mozilla) {
pandora.user.ui.theme = 'classic';

View file

@ -39,7 +39,7 @@ pandora.URL = (function() {
item: ''
});
},
'^(calendar|calendars|clips|icons|flow|map|maps|timelines)$': function() {
'^(calendar|calendars|clips|icons|flow|map|maps|timelines)$': function(url) {
pandora.UI.set({
section: 'items',
item: ''

View file

@ -441,7 +441,7 @@ pandora.ui.folderList = function(id) {
if (data.ids.length) {
$.each(pandora.$ui.folderList, function(id_, $list) {
id != id_ && $list.options('selected', []);
})
});
pandora.URL.set('?find=list:' + data.ids[0]);
} else {
pandora.URL.set('?find=');

View file

@ -73,8 +73,7 @@ pandora.ui.mainMenu = function() {
{ id: 'movies', title: 'View ' + pandora.site.itemName.plural, items: [
{ group: 'viewmovies', min: 1, max: 1, items: $.map(pandora.site.listViews, function(view, i) {
return Ox.extend({
checked: pandora.user.ui.lists[pandora.user.ui.list]
&& pandora.user.ui.lists[pandora.user.ui.list].listView == view.id,
checked: pandora.user.ui.lists[pandora.user.ui.list].listView == view.id,
}, view);
}) },
]},
@ -105,15 +104,14 @@ pandora.ui.mainMenu = function() {
{ id: 'sortmovies', title: 'Sort ' + pandora.site.itemName.plural + ' by', items: [
{ group: 'sortmovies', min: 1, max: 1, items: $.map(pandora.site.sortKeys, function(key, i) {
return Ox.extend({
checked: pandora.user.ui.lists[pandora.user.ui.list]
&& pandora.user.ui.lists[pandora.user.ui.list].sort[0].key == key.id
checked: pandora.user.ui.lists[pandora.user.ui.list].sort[0].key == key.id
}, key);
}) }
] },
{ id: 'ordermovies', title: 'Order ' + pandora.site.itemName.plural, items: [
{ group: 'ordermovies', min: 1, max: 1, items: [
{ id: 'ascending', title: 'Ascending', checked: pandora.user.ui.lists[pandora.user.ui.list] && pandora.user.ui.lists[pandora.user.ui.list].sort[0].operator === '' },
{ id: 'descending', title: 'Descending', checked: pandora.user.ui.lists[pandora.user.ui.list] && pandora.user.ui.lists[pandora.user.ui.list].sort[0].operator == '-' }
{ id: 'ascending', title: 'Ascending', checked: pandora.user.ui.lists[pandora.user.ui.list].sort[0].operator === '' },
{ id: 'descending', title: 'Descending', checked: pandora.user.ui.lists[pandora.user.ui.list].sort[0].operator == '-' }
]}
] },
{ id: 'advancedsort', title: 'Advanced Sort...', keyboard: 'shift control s' },
@ -178,7 +176,7 @@ pandora.ui.mainMenu = function() {
else
url(id);
} else if (data.id == 'ordermovies') {
pandora.$ui.list.sortList(pandora.user.ui.lists[pandora.user.ui.list] && pandora.user.ui.lists[pandora.user.ui.list].sort[0].key, value == 'ascending' ? '' : '-');
pandora.$ui.list.sortList(pandora.user.ui.lists[pandora.user.ui.list].sort[0].key, value == 'ascending' ? '' : '-');
} else if (data.id == 'sortmovies') {
var operator = pandora.getSortOperator(value);
pandora.$ui.mainMenu.checkItem('sortMenu_ordermovies_' + (operator === '' ? 'ascending' : 'descending'));
@ -193,7 +191,7 @@ pandora.ui.mainMenu = function() {
pandora.$ui.item.reload();
}
$list = pandora.$ui.browser;
} else if (pandora.user.ui.lists[pandora.user.ui.list] && pandora.user.ui.lists[pandora.user.ui.list].listView == 'icons') {
} else if (pandora.user.ui.lists[pandora.user.ui.list].listView == 'icons') {
$list = pandora.$ui.list
}
$list && $list.options({