From 2f0dc60ddd2ffac811a0c338fd54e841ced1d8be Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 31 Oct 2011 16:45:55 +0000 Subject: [PATCH] fixing bugs in menu and info view --- static/js/pandora/infoView.js | 4 ++-- static/js/pandora/menu.js | 26 +++++++++++++++----------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/static/js/pandora/infoView.js b/static/js/pandora/infoView.js index 46f4522b3..ef6cabf86 100644 --- a/static/js/pandora/infoView.js +++ b/static/js/pandora/infoView.js @@ -292,9 +292,9 @@ pandora.ui.infoView = function(data) { .css(css) .appendTo($text); html = []; - ['genre', 'keywords'].forEach(function(key) { + ['genre', 'keyword'].forEach(function(key) { data[key] && html.push( - formatKey(key) + formatKey(key == 'keyword' ? 'keywords' : key) + formatValue(data[key], key) ); }); diff --git a/static/js/pandora/menu.js b/static/js/pandora/menu.js index 60457a530..71e5027be 100644 --- a/static/js/pandora/menu.js +++ b/static/js/pandora/menu.js @@ -282,6 +282,7 @@ pandora.ui.mainMenu = function() { if (!!data.value != !!data.previousValue) { that[data.value ? 'disableItem' : 'enableItem']('showgroups'); that[data.value ? 'enableItem' : 'disableItem']('showbrowser'); + that.replaceMenu('sortMenu', getSortMenu()); } if (!data.value) { that.disableItem('showannotations'); @@ -360,17 +361,20 @@ pandora.ui.mainMenu = function() { var ui = pandora.user.ui, isClipView = pandora.isClipView(ui.listView); return { id: 'sortMenu', title: 'Sort', items: [ - { id: 'sortmovies', title: 'Sort ' + (isClipView ? 'Clips' : pandora.site.itemName.plural) + ' by', items: [ - { group: 'sortmovies', min: 1, max: 1, items: Ox.merge(isClipView ? Ox.merge(pandora.site.clipKeys.map(function(key) { - return Ox.extend(Ox.clone(key), { - checked: ui.listSort[0].key == key.id, - title: 'Clip ' + key.title - }); - }), /*{}*/[]) : [], pandora.site.sortKeys.map(function(key) { - return Ox.extend({ - checked: ui.listSort[0].key == key.id - }, key); - })) } + { id: 'sortmovies', title: 'Sort ' + (isClipView || ui.item ? 'Clips' : pandora.site.itemName.plural) + ' by', items: [ + { group: 'sortmovies', min: 1, max: 1, items: Ox.merge( + isClipView ? pandora.site.clipKeys.map(function(key) { + return Ox.extend(Ox.clone(key), { + checked: ui.listSort[0].key == key.id, + title: 'Clip ' + key.title + }); + }) : [], + !ui.item ? pandora.site.sortKeys.map(function(key) { + return Ox.extend({ + checked: ui.listSort[0].key == key.id + }, key); + }) : [] + ) } ] }, { id: 'ordermovies', title: 'Order ' + (isClipView ? 'Clips' : pandora.site.itemName.plural), items: [ { group: 'ordermovies', min: 1, max: 1, items: [