summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js')
-rw-r--r--www/js/shows.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/www/js/shows.js b/www/js/shows.js
index f125991..233a5c3 100644
--- a/www/js/shows.js
+++ b/www/js/shows.js
@@ -96,7 +96,7 @@ Rdxport.ShowListView.prototype.updateSelector = function() {
var $showSelector = $('#show-selector');
$showSelector.off();
- $('option', $showSelector).remove();
+ $('li', $showSelector).remove();
$(this.model.groups).sort(function(a, b) {
if(a.title.toLowerCase() == b.title.toLowerCase()) {
@@ -104,9 +104,16 @@ Rdxport.ShowListView.prototype.updateSelector = function() {
}
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));
+ var name = show.id + ' | <strong>' + show.title + '</strong> (' + show.rhythm + ', ' + weekday[show.dayofweek] + ', ' + show.starttime + ', ' + show.length + ' Min.)';
+ var link = $('<a>').attr('href', '#').html(name).click(function() {
+ self.setCurrentShowId(show.id);
+ self.getCurrentShowView().model.fetchCarts();
+ });
+ $showSelector.append($('<li>').append(link));
});
+ if($showSelector.children().length == 0) {
+ $showSelector.append($('<li>').append($('<a>').text('Keine Sendung gefunden!')));
+ }
// todo: maybe integrate this into setCurrentShowId?
if (!this.currentShowId) {
@@ -117,12 +124,6 @@ Rdxport.ShowListView.prototype.updateSelector = function() {
this.setCurrentShowId(this.model.groups[0].id);
}
}
- $('option[value="' + this.currentShowId + '"]', $showSelector).attr('selected', 'selected');
-
- $showSelector.on('change', function() {
- self.setCurrentShowId($('option:selected', $showSelector).attr('value'));
- self.getCurrentShowView().model.fetchCarts();
- });
this.getCurrentShowView().model.fetchCarts();
};