From 73da941644c4ee6cd03437815690c2cfaae4d958 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Wed, 12 Apr 2017 21:30:09 +0000
Subject: [PATCH] Allow changing current stop by clicking on one in tram schedule table

---
 index.js |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/index.js b/index.js
index fd3d883..04e285b 100644
--- a/index.js
+++ b/index.js
@@ -257,6 +257,7 @@
 			addCellWithText(tr, data.old[i].stop_seq_num + '. ' + data.old[i].stop.name);
 			
 			tr.className = 'active';
+			tr.addEventListener('click', function(stopId){ return function(){ loadTimes(stopId); } }(data.old[i].stop.shortName) );
 			route_table.appendChild(tr);
 		}
 		
@@ -268,6 +269,7 @@
 			if(data.actual[i].status == 'STOPPING') {
 				tr.className = 'success';
 			}
+			tr.addEventListener('click', function(stopId){ return function(){ loadTimes(stopId); } }(data.actual[i].stop.shortName) );
 			route_table.appendChild(tr);
 		}
 	}).fail(fail_ajax);

--
Gitblit v1.9.1