summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-07-03 14:30:30 +0200
committerJo-Philipp Wich <jo@mein.io>2020-07-05 00:11:59 +0200
commit0c479891ae31bbe308c4d6e181c118ec3d65c05f (patch)
tree0d94e34e9abd17a27087e29473deb23ded004970 /modules/luci-base/htdocs
parentdcea4e84f4990b473a6b6dd24f69abb9ac061f71 (diff)
luci-base: ui.js: order menu entries with the same weight by name
The previous server side menu rendering ordered items first by their order weight value, then by their internal name. Do the same for client side menu rendering. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/htdocs')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/ui.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/ui.js b/modules/luci-base/htdocs/luci-static/resources/ui.js
index a6598355d..91a93b9e9 100644
--- a/modules/luci-base/htdocs/luci-static/resources/ui.js
+++ b/modules/luci-base/htdocs/luci-static/resources/ui.js
@@ -3053,7 +3053,13 @@ var UIMenu = baseclass.singleton(/** @lends LuCI.ui.menu.prototype */ {
}
return children.sort(function(a, b) {
- return ((a.order || 1000) - (b.order || 1000));
+ var wA = a.order || 1000,
+ wB = b.order || 1000;
+
+ if (wA != wB)
+ return wA - wB;
+
+ return a.name > b.name;
});
}
});