From 1054cfb07c5610d8053ade8f092fcdde6fa1c4ea Mon Sep 17 00:00:00 2001 From: rolux Date: Tue, 16 Aug 2011 13:55:18 +0000 Subject: [PATCH] fix bug in menu (check if a list exists in user ui prefs before accessing its properties) --- static/js/pandora/ui/menu.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/static/js/pandora/ui/menu.js b/static/js/pandora/ui/menu.js index 5ed58f845..dfa1f2529 100644 --- a/static/js/pandora/ui/menu.js +++ b/static/js/pandora/ui/menu.js @@ -74,7 +74,7 @@ pandora.ui.mainMenu = function() { { 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 : false, + && pandora.user.ui.lists[pandora.user.ui.list].listView == view.id, }, view); }) }, ]}, @@ -106,14 +106,14 @@ pandora.ui.mainMenu = function() { { 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 : false, + && 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].sort[0].operator === '' }, - { id: 'descending', title: 'Descending', checked: pandora.user.ui.lists[pandora.user.ui.list].sort[0].operator == '-' } + { 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: 'advancedsort', title: 'Advanced Sort...', keyboard: 'shift control s' }, @@ -178,7 +178,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].sort[0].key, value == 'ascending' ? '' : '-'); + 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' ? '' : '-'); } else if (data.id == 'sortmovies') { var operator = pandora.getSortOperator(value); pandora.$ui.mainMenu.checkItem('sortMenu_ordermovies_' + (operator === '' ? 'ascending' : 'descending')); @@ -193,7 +193,7 @@ pandora.ui.mainMenu = function() { pandora.$ui.item.reload(); } $list = pandora.$ui.browser; - } else if (pandora.user.ui.lists[pandora.user.ui.list].listView == 'icons') { + } else if (pandora.user.ui.lists[pandora.user.ui.list] && pandora.user.ui.lists[pandora.user.ui.list].listView == 'icons') { $list = pandora.$ui.list } $list && $list.options({