define sections in one location

This commit is contained in:
j 2019-12-09 13:12:44 +00:00
commit 5168ed4a33
4 changed files with 11 additions and 16 deletions

View file

@ -1647,12 +1647,10 @@ pandora.ui.mainMenu = function() {
function getViewMenu() {
return { id: 'viewMenu', title: Ox._('View'), 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._(Ox.toTitleCase(section)),
checked: ui.section == section
};
{ group: 'viewsection', min: 1, max: 1, items: pandora.site.sections.map(function(section) {
section = Ox.extend({}, section)
section.checked = section.id == ui.section;
return section;
}) }
] },
{},