From 969115b78ffc6c228d5eb0abdacfdd758470f299 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Wed, 12 Apr 2017 21:30:07 +0000
Subject: [PATCH] Change where stop_id is set to mimick loadRoute() behavior

---
 index.js |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/index.js b/index.js
index a5aba2b..24a3a37 100644
--- a/index.js
+++ b/index.js
@@ -151,8 +151,9 @@
 	if(times_xhr) times_xhr.abort();
 	
 	console.log('loadTimes(' + stopId + ')');
+	stop_id = stopId;
 	
-	window.location.hash = '#!' + language + stop_id;
+	window.location.hash = '#!' + language + stopId;
 	refresh_button.removeAttribute('disabled');
 	
 	loading_start();
@@ -410,8 +411,7 @@
 	stop_name_form.addEventListener('submit', function(e) {
 		e.preventDefault();
 		if(!stop_name_autocomplete.value) return;
-		stop_id = stop_name_autocomplete.value;
-		loadTimes(stop_id);
+		loadTimes(stop_name_autocomplete.value);
 	});
 	
 	refresh_button.addEventListener('click', function(e) {

--
Gitblit v1.9.1