From 6e8a338f8a9737d2d4f2de7aa7cb82291d9f8bd3 Mon Sep 17 00:00:00 2001 From: j Date: Sat, 8 Jul 2023 19:13:14 +0530 Subject: [PATCH] add submenu seperator, closes #1983 --- static/js/mainMenu.js | 47 +++++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 13 deletions(-) diff --git a/static/js/mainMenu.js b/static/js/mainMenu.js index 07f608e8..a7906d8a 100644 --- a/static/js/mainMenu.js +++ b/static/js/mainMenu.js @@ -1690,19 +1690,40 @@ pandora.ui.mainMenu = function() { Ox._('Open {0}', [Ox._(pandora.site.itemName.singular)]), Ox._('Open {0}', [Ox._(pandora.site.itemName.plural)]) ], items: [ - { group: 'itemview', min: 1, max: 1, items: pandora.site.itemViews.filter(function(view) { - return view.id != 'data' && view.id != 'media' || - pandora.hasCapability('canSeeExtraItemViews'); - }).map(function(view) { - return Ox.extend({ - checked: ui.itemView == view.id - }, view, { - keyboard: itemViewKey <= 10 - ? 'shift ' + (itemViewKey++%10) - : void 0, - title: Ox._(view.title) - }); - }) }, + { + group: 'itemview', + min: 1, + max: 1, + items: [].concat( + pandora.site.itemViews.filter(function(view) { + return view.id != 'data' && view.id != 'media' + }).map(function(view) { + return Ox.extend({ + checked: ui.itemView == view.id + }, view, { + keyboard: itemViewKey <= 10 + ? 'shift ' + (itemViewKey++%10) + : void 0, + title: Ox._(view.title) + }); + }), + pandora.hasCapability('canSeeExtraItemViews') ? [{}] : [], + pandora.hasCapability('canSeeExtraItemViews') + ? pandora.site.itemViews.filter(function(view) { + return view.id == 'data' || view.id == 'media' + }).map(function(view) { + return Ox.extend({ + checked: ui.itemView == view.id + }, view, { + keyboard: itemViewKey <= 10 + ? 'shift ' + (itemViewKey++%10) + : void 0, + title: Ox._(view.title) + }); + }) + : [], + ) + }, ] }, { id: 'clips', title: Ox._('Open Clips'), items: [ { group: 'videoview', min: 1, max: 1, items: ['player', 'editor', 'timeline'].map(function(view) {