update sortSelect, sortKeys are now pre-filtered

This commit is contained in:
rolux 2012-06-30 20:04:18 +00:00
parent 0d5fda8921
commit be702c5d43

View file

@ -15,12 +15,7 @@ pandora.ui.sortSelect = function(isNavigationView) {
if (!pandora.user.ui.item) { if (!pandora.user.ui.item) {
items = [].concat( items = [].concat(
items, items,
pandora.site.sortKeys.filter(function(key) { pandora.site.sortKeys.map(function(key) {
return Ox.getIndexById(items, key.id) == -1 && (
!key.capability
|| pandora.site.capabilities[key.capability][pandora.user.level]
);
}).map(function(key) {
return Ox.extend(Ox.clone(key), { return Ox.extend(Ox.clone(key), {
title: 'Sort by ' + key.title title: 'Sort by ' + key.title
}); });