forked from 0x2620/pandora
fix bug when switching to a view that doesn't have the current sort key; update view movies menu when switching view
This commit is contained in:
parent
d066835061
commit
55b517b54b
3 changed files with 25 additions and 6 deletions
|
@ -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,
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue