diff --git a/static/js/pandora/ui/list.js b/static/js/pandora/ui/list.js index 0706d5bb2..2328c07f7 100644 --- a/static/js/pandora/ui/list.js +++ b/static/js/pandora/ui/list.js @@ -149,9 +149,10 @@ pandora.ui.list = function() { ui.icons == 'posters' ? (ui.showSitePoster ? 'siteposter' : 'poster') : 'icon' ) + size + '.jpg', - format, info, sortKey; - if (['title', 'director'].indexOf(sort[0].key) > -1) { - info = data['year'] + sortKey = sort[0].key, + format, info; + if (['title', 'director'].indexOf(sortKey) > -1) { + info = data['year']; } else { sortKey = sort[0].key, format = pandora.getSortKeyData(sortKey).format, diff --git a/static/js/pandora/ui/menu.js b/static/js/pandora/ui/menu.js index a0958682e..9b340d553 100644 --- a/static/js/pandora/ui/menu.js +++ b/static/js/pandora/ui/menu.js @@ -210,7 +210,14 @@ pandora.ui.mainMenu = function() { } else if (data.id == 'viewicons') { pandora.UI.set({icons: value}); } else if (data.id == 'viewmovies') { - pandora.UI.set('listView', value); + var set = {listView: value}; + if ( + !pandora.isClipView(key, pandora.user.ui.item) + && ['title', 'position'].indexOf(pandora.user.ui.listSort[0].key) > -1 + ) { + set.listSort = pandora.site.user.ui.listSort; + } + pandora.UI.set(set); } else if (['personallists', 'favoritelists', 'featuredlists'].indexOf(value) > -1) { pandora.UI.set({list: value.substr(8)}); } @@ -277,6 +284,7 @@ pandora.ui.mainMenu = function() { that[data.value.length ? 'enableItem' : 'disableItem']('newlistfromselection'); }, pandora_listview: function(data) { + pandora.$ui.mainMenu.checkItem('viewMenu_movies_' + data.value); if (pandora.isClipView() != pandora.isClipView(data.previousValue)) { that.replaceMenu('sortMenu', getSortMenu()); } diff --git a/static/js/pandora/ui/viewSelect.js b/static/js/pandora/ui/viewSelect.js index 7e46b440a..6deca0cac 100644 --- a/static/js/pandora/ui/viewSelect.js +++ b/static/js/pandora/ui/viewSelect.js @@ -1,7 +1,8 @@ // vim: et:ts=4:sw=4:sts=4:ft=javascript pandora.ui.viewSelect = function() { - var viewKey = !pandora.user.ui.item ? 'listView' : 'itemView', + var sortKey = !pandora.user.ui.item ? 'listSort' : 'itemSort', + viewKey = !pandora.user.ui.item ? 'listView' : 'itemView', that = Ox.Select({ id: 'viewSelect', items: Ox.map(pandora.site[viewKey + 's'], function(view) { @@ -22,7 +23,16 @@ pandora.ui.viewSelect = function() { }) .bindEvent({ change: function(data) { - pandora.UI.set(viewKey, data.selected[0].id); + var key = data.selected[0].id, + set = {}; + set[viewKey] = key + if ( + !pandora.isClipView(key, pandora.user.ui.item) + && ['title', 'position'].indexOf(pandora.user.ui[sortKey][0].key) > -1 + ) { + set[sortKey] = pandora.site.user.ui.listSort; + } + pandora.UI.set(set); }, pandora_listview: function(data) { that.selectItem(data.value);