From 55a6c166b6110390597b877d181415a0ae16528b Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Mon, 12 May 2014 15:46:37 +0000 Subject: [PATCH] Added missing call of getLocation if getGeolocation fails. --- www/events.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/www/events.js b/www/events.js index a632b48..a0e9023 100644 --- a/www/events.js +++ b/www/events.js @@ -87,12 +87,9 @@ function ajaxLoadEvents(stime, etime) { var location // try to use location with reverse geolocation lookup (nominatim), check cache first // use getLocation if it fails or description -> text if it also fails - if ( geolocationTable[id] ) { - location = geolocationTable[id]; - } else { - location = getGeolocation(id, lat, lng); - ( location ) ? null : location = $(this).find('description > text').text(); - }; + ( location = geolocationTable[id] ) ? null : location = getGeolocation(id, lat, lng); + ( location ) ? null : location = getLocation(lat, lng)[0]; + ( location ) ? null : $(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)