diff --git a/static/js/pandora/ui/folderBrowserList.js b/static/js/pandora/ui/folderBrowserList.js index 11074fc4..f9353080 100644 --- a/static/js/pandora/ui/folderBrowserList.js +++ b/static/js/pandora/ui/folderBrowserList.js @@ -126,7 +126,7 @@ pandora.ui.folderBrowserList = function(id) { }, visible: true, width: 16 - }, + } ], columnsVisible: true, items: function(data, callback) { @@ -140,6 +140,10 @@ pandora.ui.folderBrowserList = function(id) { query: query }), callback); }, + // needed in order to determine if, when switching back + // from featured browser to featured folder, the selected + // not-featured list may be in the user's favorites folder + keys: id == 'featured' ? ['subscribed'] : [], pageLength: 1000, selected: pandora.getListData().folder == id ? [pandora.user.ui.list] : [], sort: [ diff --git a/static/js/pandora/ui/folders.js b/static/js/pandora/ui/folders.js index 312e5cc6..db3b8b63 100644 --- a/static/js/pandora/ui/folders.js +++ b/static/js/pandora/ui/folders.js @@ -90,7 +90,7 @@ pandora.ui.folders = function() { pandora.$ui.folderList.favorite.options('selected').length && !listData.subscribed ) { - // the selected list in the favorite browser is not in the favorite folder + // the selected list in the favorites browser is not in the favorites folder pandora.$ui.folderList.favorite.options({selected: []}); if (Ox.getObjectById(pandora.site.sectionFolders.items, 'featured').showBrowser) { // but in the featured browser @@ -140,8 +140,11 @@ pandora.ui.folders = function() { if (listData.user == pandora.user.username) { // but in the personal folder pandora.$ui.folderList.personal.options({selected: [listData.id]}); - } else if (Ox.getObjectById(pandora.site.sectionFolders.items, 'favorite').showBrowser) { - // but in the favorite browser + } else if ( + listData.subscribed + || Ox.getObjectById(pandora.site.sectionFolders.items, 'favorite').showBrowser + ) { + // but in the favorites folder or browser pandora.$ui.folderList.favorite.options({selected: [listData.id]}); } else { // and nowhere else