From 9617cc5fa3a9f9b7c97bda4da593303e9f528581 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Tue, 27 May 2014 11:37:07 +0000 Subject: [PATCH] Fixed bug: locations where shown as 'undefined' if nominatim lookup times out. --- www/events.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/events.js b/www/events.js index 7a234b2..5725eba 100644 --- a/www/events.js +++ b/www/events.js @@ -109,8 +109,8 @@ function ajaxLoadEvents(stime, etime, id, target) { var location // get location, try this in order: // regional map name, given value, cached value, or nominatim lookup - location = ( getLocation(lat, lng)[0] || $(this).find('description > text').text() ); - location = ( geolocationTable[id] || getGeolocation(id, lat, lng) ); + geolocationTable[id] ? null : getGeolocation(id, lat, lng); // do AJAX lookup if not cached, location will be updated later + location = ( geolocationTable[id] || getLocation(lat, lng)[0] || $(this).find('description > text').text() ); // create table row: Date, Time, Mag, Location if ( !eventTable[id] && $.inArray(type, config['event']['typeWhitelist'] )+1 && $.inArray(evaluationStatus, config['event']['evaluationBlacklist'])<0 && Number(mag)+0.05 >= config['event']['minMag'] ) { // general event info (1st line)