From ef36c9491b63d962bade51263b931a900866fc5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Schr=C3=B6der?= Date: Tue, 16 Feb 2016 15:49:56 +0100 Subject: [PATCH] correctly sort menus (unfortunately lua does not return sorted tables but we can sort by uci name) --- juci/src/js/juci.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/juci/src/js/juci.js b/juci/src/js/juci.js index de523001..6b71b628 100644 --- a/juci/src/js/juci.js +++ b/juci/src/js/juci.js @@ -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];