From 67533dcac682e8b6f58ffd294623aba4353a9275 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Mon, 5 Aug 2013 17:40:18 +0100 Subject: Only stop listening to search events once search complete Don't stop listening to all locator events as that stops the current location GPS function working. Fixes #80. --- src/js/views/around.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/views/around.js b/src/js/views/around.js index 910cf38..501c371 100644 --- a/src/js/views/around.js +++ b/src/js/views/around.js @@ -308,7 +308,8 @@ }, searchSuccess: function( info ) { - this.stopListening(FMS.locator); + this.stopListening(FMS.locator, 'search_located'); + this.stopListening(FMS.locator, 'search_failed'); var coords = info.coordinates; if ( fixmystreet.map ) { fixmystreet.map.panTo(this.projectCoords( coords )); @@ -352,7 +353,8 @@ searchFail: function( details ) { // this makes sure any onscreen keyboard is dismissed $('#submit').focus(); - this.stopListening(FMS.locator); + this.stopListening(FMS.locator, 'search_located'); + this.stopListening(FMS.locator, 'search_failed'); if ( details.msg ) { this.searchError( details.msg ); } else if ( details.locations ) { -- cgit v1.2.3