add new switches

This commit is contained in:
Wolfgang Hottgenroth
2015-06-10 17:21:59 +02:00
parent 19628552ee
commit eed7bc8d26
2 changed files with 5 additions and 1 deletions

View File

@ -11,8 +11,9 @@
async: false
});
var switchMapping = $.getJSON('/switchMapping').responseJSON;
var sortedKeys = Object.keys(switchMapping).sort(function(a,b){return switchMapping[a]['index'] - switchMapping[b]['index']});
var firstListItem = $("li:first", "#switchlist");
for (var key in switchMapping) {
for (var key in sortedKeys) {
var newListItem = firstListItem.clone()
var href = newListItem.children('a')
href.attr('id', key);