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>
This commit is contained in:
parent
dcea4e84f4
commit
0c479891ae
1 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue