aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-08-05 17:40:18 +0100
committerStruan Donald <struan@exo.org.uk>2013-08-05 17:40:18 +0100
commit67533dcac682e8b6f58ffd294623aba4353a9275 (patch)
tree7a05c9e9fe48a8c31d84b876519a0af2e39e2d81 /src
parentedc385fdac71547b296f54dd2ec32e25d950544f (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/js/views/around.js6
1 files 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 ) {