publik.js: fix ordering of sidebar menu items (#7685)

This commit is contained in:
Frédéric Péters 2015-06-25 21:25:46 +02:00
parent dea9ab0b7d
commit f2d92078cc
1 changed files with 11 additions and 0 deletions

View File

@ -22,6 +22,17 @@ $(function() {
$('#sidepage-menu').remove();
var menu_links = $('<ul id="sidepage-menu">');
var more_entries = Array();
var service_order = Array('authentic', 'wcs', 'combo', 'passerelle', 'hobo');
COMBO_KNOWN_SERVICES.sort(function(a, b) {
a_service_order = service_order.indexOf(a.service_id);
b_service_order = service_order.indexOf(b.service_id);
if (a_service_order == b_service_order) {
return a.service_id.localeCompare(b.service_id);
}
if (a_service_order < 0) return 1;
if (b_service_order < 0) return -1;
return a_service_order - b_service_order;
});
$(COMBO_KNOWN_SERVICES).each(function(index, service) {
if (service.data === undefined || service.data.length == 0) {
return;