add section selection to view menu
This commit is contained in:
parent
49d1b7860d
commit
865188d97d
2 changed files with 17 additions and 3 deletions
|
@ -50,7 +50,18 @@ pandora.ui.mainMenu = function() {
|
||||||
getListMenu(),
|
getListMenu(),
|
||||||
getItemMenu(),
|
getItemMenu(),
|
||||||
{ id: 'viewMenu', title: Ox._('View'), items: [
|
{ 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) {
|
{ group: 'listview', min: 1, max: 1, items: pandora.site.listViews.map(function(view) {
|
||||||
return Ox.extend({
|
return Ox.extend({
|
||||||
checked: ui.listView == view.id
|
checked: ui.listView == view.id
|
||||||
|
@ -335,6 +346,8 @@ pandora.ui.mainMenu = function() {
|
||||||
operator: '&'
|
operator: '&'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else if (data.id == 'viewsection') {
|
||||||
|
pandora.UI.set({section: value});
|
||||||
} else if (data.id == 'viewtimelines') {
|
} else if (data.id == 'viewtimelines') {
|
||||||
pandora.UI.set({videoTimeline: value});
|
pandora.UI.set({videoTimeline: value});
|
||||||
}
|
}
|
||||||
|
@ -738,7 +751,8 @@ pandora.ui.mainMenu = function() {
|
||||||
pandora.getItemIdAndPosition() ? 'enableItem' : 'disableItem'
|
pandora.getItemIdAndPosition() ? 'enableItem' : 'disableItem'
|
||||||
]('findsimilar');
|
]('findsimilar');
|
||||||
},
|
},
|
||||||
pandora_section: function() {
|
pandora_section: function(data) {
|
||||||
|
that.checkItem('viewMenu_section_' + data.value);
|
||||||
that.replaceMenu('listMenu', getListMenu());
|
that.replaceMenu('listMenu', getListMenu());
|
||||||
that.replaceMenu('itemMenu', getItemMenu());
|
that.replaceMenu('itemMenu', getItemMenu());
|
||||||
that.replaceMenu('sortMenu', getSortMenu());
|
that.replaceMenu('sortMenu', getSortMenu());
|
||||||
|
|
|
@ -15,7 +15,7 @@ pandora.ui.sectionSelect = function(section) {
|
||||||
margin: '4px'
|
margin: '4px'
|
||||||
})
|
})
|
||||||
.bindEvent({
|
.bindEvent({
|
||||||
|
// ...
|
||||||
});
|
});
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue