forked from 0x2620/pandora
in viewSelect, add separator between standard and extra item views
This commit is contained in:
parent
4f3593a6b9
commit
5cee28bef1
1 changed files with 37 additions and 29 deletions
|
@ -6,17 +6,25 @@ pandora.ui.viewSelect = function() {
|
||||||
var ui = pandora.user.ui,
|
var ui = pandora.user.ui,
|
||||||
sortKey = !ui.item ? 'listSort' : 'itemSort',
|
sortKey = !ui.item ? 'listSort' : 'itemSort',
|
||||||
viewKey = !ui.item ? 'listView' : 'itemView',
|
viewKey = !ui.item ? 'listView' : 'itemView',
|
||||||
that = Ox.Select({
|
items = Ox.map(pandora.site[viewKey + 's'], function(view) {
|
||||||
id: 'viewSelect',
|
return ['data', 'files'].indexOf(view.id) == -1
|
||||||
items: Ox.map(pandora.site[viewKey + 's'], function(view) {
|
? {id: view.id, title: 'View ' + view.title}
|
||||||
return viewKey == 'listView'
|
|
||||||
|| ['data', 'files'].indexOf(view.id) == -1
|
|
||||||
|| pandora.site.capabilities.canSeeExtraItemViews[pandora.user.level]
|
|
||||||
? Ox.extend(Ox.clone(view), {
|
|
||||||
title: 'View ' + view.title
|
|
||||||
})
|
|
||||||
: null;
|
: null;
|
||||||
}),
|
}),
|
||||||
|
that;
|
||||||
|
if (
|
||||||
|
viewKey == 'itemView'
|
||||||
|
&& pandora.site.capabilities.canSeeExtraItemViews[pandora.user.level]
|
||||||
|
) {
|
||||||
|
Ox.merge(items, [
|
||||||
|
{},
|
||||||
|
{id: 'data', title: 'View Data'},
|
||||||
|
{id: 'files', title: 'View Files'}
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
that = Ox.Select({
|
||||||
|
id: 'viewSelect',
|
||||||
|
items: items,
|
||||||
value: ui[viewKey],
|
value: ui[viewKey],
|
||||||
width: !ui.item ? 144 : 128
|
width: !ui.item ? 144 : 128
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue