From 71ff52ffa1684bb1f09eff8036eccbd8b3b8e38a Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Thu, 11 May 2017 17:14:39 +0200 Subject: add today button for schedules diff --git a/www/js/schedules.js b/www/js/schedules.js index d4aa8a2..327d19a 100644 --- a/www/js/schedules.js +++ b/www/js/schedules.js @@ -69,6 +69,13 @@ rh.ShowList.prototype.fetch = function() { }); }; +rh.ShowList.prototype.today = function() { + if(!this.request_sent) { + this.current = new Date(); + this.fetch(); + } +}; + rh.ShowList.prototype.prev = function() { if(!this.request_sent) { this.current = new Date(this.current.valueOf() - 24*3600*1000); @@ -196,10 +203,15 @@ function schedules_init() { shows = new rh.ShowList(d); showListView = new rh.ShowListView(shows); + $('#btn-today').click(schedules_today); $('#btn-earlier').click(schedules_prev); $('#btn-later').click(schedules_next); } +function schedules_today() { + shows.today(); +} + function schedules_prev() { shows.prev(); } diff --git a/www/schedules.html b/www/schedules.html index 0708c29..8e47b66 100644 --- a/www/schedules.html +++ b/www/schedules.html @@ -19,6 +19,7 @@
+
-- cgit v0.10.2