From 0c479891ae31bbe308c4d6e181c118ec3d65c05f Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 3 Jul 2020 14:30:30 +0200 Subject: 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 --- modules/luci-base/htdocs/luci-static/resources/ui.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'modules/luci-base') diff --git a/modules/luci-base/htdocs/luci-static/resources/ui.js b/modules/luci-base/htdocs/luci-static/resources/ui.js index a6598355d6..91a93b9e90 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; }); } }); -- cgit v1.2.3