aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-07-26 12:29:44 +0100
committerStruan Donald <struan@exo.org.uk>2013-07-26 12:29:44 +0100
commit2fdaad76631a256ec79841807ac4368ebe6ad83c (patch)
tree18371b09e5f5cc357f66ad781dde63ca7489e510
parent1c91cd9502370a41bc21d3f7148d0ef6b16f102f (diff)
More reliably make sure crosshair is displayed
The touchstart event seem unreliable in combination with openlayers and also the ability of backbone to capture events from an element not managed by it is also suspect so use touchend which is more reliable and directly manage handling it. It's not as neat but it works reliably :/
-rw-r--r--src/js/views/around.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/js/views/around.js b/src/js/views/around.js
index 912d5e0..c3a2fcc 100644
--- a/src/js/views/around.js
+++ b/src/js/views/around.js
@@ -8,7 +8,6 @@
'pagehide': 'destroy',
'pagebeforeshow': 'beforeDisplay',
'pageshow': 'afterDisplay',
- 'touchstart #map': 'mapTouchStart',
'vclick #locate_cancel': 'goSearch',
'vclick #login-options': 'goLogin',
'vclick #view-my-reports': 'goReports',
@@ -45,6 +44,7 @@
$('#cancel').hide();
$('#map_box').removeClass('background-map');
this.fixPageHeight();
+ $('#map_box').on('touchend', function() { if ( ! $('#popup').length ) { $('#OpenLayers_Control_Crosshairs_crosshairs').show(); } } );
},
afterDisplay: function() {
@@ -201,10 +201,6 @@
fixmystreet.report_location.setVisibility(true);
},
- mapTouchStart: function(e) {
- $('#OpenLayers_Control_Crosshairs_crosshairs').show();
- },
-
onClickMark: function(e) {
e.preventDefault();
this.displayButtons(true);
@@ -337,6 +333,7 @@
this.stopListening(FMS.locator);
FMS.locator.stopTracking();
$('#map_box').addClass('background-map');
+ $('#map_box').off('touchend');
if ( fixmystreet.map ) {
fixmystreet.nav.deactivate();
fixmystreet.actionafterdrag.deactivate();