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>
(cherry picked from commit
0c479891ae31bbe308c4d6e181c118ec3d65c05f)
}
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;
});
}
});