diff --git a/static/js/mainMenu.js b/static/js/mainMenu.js index 089d6bbde..6c72c3db1 100644 --- a/static/js/mainMenu.js +++ b/static/js/mainMenu.js @@ -50,7 +50,18 @@ pandora.ui.mainMenu = function() { getListMenu(), getItemMenu(), { id: 'viewMenu', title: Ox._('View'), items: [ - { id: 'items', title: Ox._('View {0}', [Ox._(pandora.site.itemName.plural)]), items: [ + { id: 'section', title: Ox._('Section'), items: [ + { group: 'viewsection', min: 1, max: 1, items: Object.keys(pandora.site.sectionFolders).map(function(section) { + return { + id: section, + title: section == 'items' ? Ox._(pandora.site.itemName.plural) : Ox.toTitleCase(section), + checked: ui.section == section, + disabled: section != 'items' && pandora.user.level != 'admin' + }; + }) } + ] }, + {}, + { id: 'movies', title: Ox._('View {0}', [Ox._(pandora.site.itemName.plural)]), items: [ { group: 'listview', min: 1, max: 1, items: pandora.site.listViews.map(function(view) { return Ox.extend({ checked: ui.listView == view.id @@ -335,6 +346,8 @@ pandora.ui.mainMenu = function() { operator: '&' } }); + } else if (data.id == 'viewsection') { + pandora.UI.set({section: value}); } else if (data.id == 'viewtimelines') { pandora.UI.set({videoTimeline: value}); } @@ -738,7 +751,8 @@ pandora.ui.mainMenu = function() { pandora.getItemIdAndPosition() ? 'enableItem' : 'disableItem' ]('findsimilar'); }, - pandora_section: function() { + pandora_section: function(data) { + that.checkItem('viewMenu_section_' + data.value); that.replaceMenu('listMenu', getListMenu()); that.replaceMenu('itemMenu', getItemMenu()); that.replaceMenu('sortMenu', getSortMenu()); diff --git a/static/js/sectionSelect.js b/static/js/sectionSelect.js index 90a99105c..543527a5e 100644 --- a/static/js/sectionSelect.js +++ b/static/js/sectionSelect.js @@ -15,7 +15,7 @@ pandora.ui.sectionSelect = function(section) { margin: '4px' }) .bindEvent({ - + // ... }); return that; };