diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-06-22 22:05:35 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-06-22 22:06:38 (GMT) |
commit | 83067ca7cb512cd76db625e5db9d08dd385df8e3 (patch) | |
tree | 8c6076cc295fcaf81db4c7fe7c317e48688c862a /www/js/shows.js | |
parent | 1338103170bf4b2b116f0a0134db86459c176f9a (diff) |
sorting show and musicpool names for selector
Diffstat (limited to 'www/js/shows.js')
-rw-r--r-- | www/js/shows.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/www/js/shows.js b/www/js/shows.js index 9104bec..f125991 100644 --- a/www/js/shows.js +++ b/www/js/shows.js @@ -98,8 +98,13 @@ Rdxport.ShowListView.prototype.updateSelector = function() { $showSelector.off(); $('option', $showSelector).remove(); - $(this.model.groups).each(function(index, show) { - var name = show.title + ' (' + show.rhythm + ', ' + weekday[show.dayofweek] + ', ' + show.starttime + ', ' + show.length + ' Min.)'; + $(this.model.groups).sort(function(a, b) { + if(a.title.toLowerCase() == b.title.toLowerCase()) { + return b.rhythm - a.rhythm; + } + return a.title.toLowerCase() >= b.title.toLowerCase() + }).each(function(index, show) { + var name = show.id + ' | ' + show.title + ' (' + show.rhythm + ', ' + weekday[show.dayofweek] + ', ' + show.starttime + ', ' + show.length + ' Min.)'; $showSelector.append($('<option>').attr('value', show.id).text(name)); }); |