correctly sort menus (unfortunately lua does not return sorted tables but we can sort by uci name)

This commit is contained in:
Martin Schröder 2016-02-16 15:49:56 +01:00
parent 8babd9af13
commit ef36c9491b

View File

@ -142,9 +142,9 @@
}
console.log("juci: loading menu from server..");
$uci.juci["@menu"].sort(function(a, b){
return String(a.path.value).localeCompare(b.path.value);
return String(a[".name"]).localeCompare(b[".name"]);
}).map(function(menu){
console.log("adding menu: "+menu.path.value);
//console.log("adding menu: "+menu.path.value);
// only include menu items that are marked as accessible based on our rights (others will simply be broken because of restricted access)
if(menu.acls.value.length && menu.acls.value.find(function(x){
return !acls[x];