more thorough fix for missing list preferences

This commit is contained in:
rolux 2011-08-16 14:19:37 +00:00
parent b810d58bee
commit a9c8954780
4 changed files with 11 additions and 10 deletions

View file

@ -89,6 +89,9 @@ Ox.load('Geo', function() {
sectionElement: 'buttons', sectionElement: 'buttons',
selectedMovies: [] 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) { if (data.user.level == 'guest' && $.browser.mozilla) {
pandora.user.ui.theme = 'classic'; pandora.user.ui.theme = 'classic';

View file

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

View file

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

View file

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