summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2017-05-11 15:14:39 (GMT)
committerChristian Pointner <equinox@helsinki.at>2017-05-11 15:14:39 (GMT)
commit71ff52ffa1684bb1f09eff8036eccbd8b3b8e38a (patch)
tree9eec01c9b8b3a53eacd9ce9fefe5264af346197e /www/js
parentf98ff4ff081c97daab98d4e6f850bc3e50e69fa1 (diff)
add today button for schedules
Diffstat (limited to 'www/js')
-rw-r--r--www/js/schedules.js12
1 files changed, 12 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();
}