diff options
author | Christian Pointner <equinox@helsinki.at> | 2017-05-11 15:14:39 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2017-05-11 15:14:39 (GMT) |
commit | 71ff52ffa1684bb1f09eff8036eccbd8b3b8e38a (patch) | |
tree | 9eec01c9b8b3a53eacd9ce9fefe5264af346197e /www | |
parent | f98ff4ff081c97daab98d4e6f850bc3e50e69fa1 (diff) |
add today button for schedules
Diffstat (limited to 'www')
-rw-r--r-- | www/js/schedules.js | 12 | ||||
-rw-r--r-- | www/schedules.html | 1 |
2 files changed, 13 insertions, 0 deletions
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 @@ <div id="control"> <div class="btn-group" role="group"> <button type="button" class="btn btn-default" id="btn-earlier"><span class="glyphicon glyphicon-minus"></span></button> + <button type="button" class="btn btn-default" id="btn-today"><span class="glyphicon glyphicon-record"></span></button> <button type="button" class="btn btn-default" id="btn-later"><span class="glyphicon glyphicon-plus"></span></button> </div> </div> |