mirror of
https://github.com/mkschreder/juci.git
synced 2025-01-08 11:57:39 +08:00
correctly sort menus (unfortunately lua does not return sorted tables but we can sort by uci name)
This commit is contained in:
parent
8babd9af13
commit
ef36c9491b
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user