From 8cd75bdd714622bbe004aca0ae82bf2169a62434 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Sat, 06 Jul 2019 15:19:19 +0000
Subject: [PATCH] Fix mismatched start-end tag in index.html

---
 map.js |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/map.js b/map.js
index bc0370f..5752841 100644
--- a/map.js
+++ b/map.js
@@ -94,7 +94,7 @@
 	
 	this._content = document.createElement('div');
 	this._element.appendChild(this._content);
-};
+}
 Panel.prototype = {
 	_element: null,
 	_hide: null,
@@ -179,6 +179,11 @@
 		var query = this.input.value.toUpperCase();
 		if(query === this.query) return;
 		this.query = query;
+		
+		if(query === '') {
+			deleteChildren(this.results);
+			return;
+		}
 		
 		var features = [];
 		stops_type.forEach(function(stop_type) {
@@ -586,6 +591,8 @@
 	}
 	// Vehicle
 	else if(ttss_types.includes(type)) {
+		styleVehicle(feature, true);
+		
 		var span = displayVehicle(feature.get('vehicle_type'));
 		
 		additional = document.createElement('p');
@@ -601,8 +608,6 @@
 		
 		vehicleTable(feature, tbody);
 		vehiclePath(feature);
-		
-		styleVehicle(feature, true);
 	}
 	// Stop or stop point
 	else if(['s', 'p'].includes(type)) {
@@ -704,6 +709,11 @@
 function listFeatures(features) {
 	var div = document.createElement('div');
 	
+	if(features.length === 0) {
+		addParaWithText(div, lang.no_results);
+		return div;
+	}
+	
 	addParaWithText(div, lang.select_feature);
 	
 	var feature, p, a, full_type, typeName;

--
Gitblit v1.9.1