aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/map-OpenLayers.js
diff options
context:
space:
mode:
authorJosh Angell <josh@supercooldesign.co.uk>2012-03-01 12:48:20 +0000
committerJosh Angell <josh@supercooldesign.co.uk>2012-03-01 12:48:20 +0000
commitb54ec9e3bb45aa84f2ba031ae1a788a7b3f89cf0 (patch)
tree8b63459c8e3d7def373d8b908ed45d6012aba66c /web/js/map-OpenLayers.js
parent2690a3d248b78ec53429077dae974fc741e68831 (diff)
parente2a347ad816f7f77ef9d06dd553f03ae22fb4636 (diff)
Merge branch 'supercool' of ssh://github.com/mysociety/fixmystreet into supercool
Diffstat (limited to 'web/js/map-OpenLayers.js')
-rw-r--r--web/js/map-OpenLayers.js47
1 files changed, 13 insertions, 34 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index cc21a0fae..6fb0a7616 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -268,7 +268,7 @@ $(function(){
$('#sub_map_links').show();
heightFix('#report-a-problem-sidebar:visible', '.content', 26);
//only on mobile
- $('.mobile #mob_sub_map_links').remove();
+ $('#mob_sub_map_links').remove();
$('.mobile-map-banner').text('Place pin on map');
fixmystreet.page = 'around';
});
@@ -382,14 +382,6 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
},
trigger: function(e) {
- if ($('html').hasClass('mobile')) {
- this.locate_report_mobile(e);
- } else {
- this.locate_report(e);
- }
- },
-
- locate_report_pin_and_council: function(e) {
var lonlat = fixmystreet.map.getLonLatFromViewPortPx(e.xy);
if (fixmystreet.page == 'new') {
/* Already have a pin */
@@ -409,7 +401,7 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
$('#hide_pins_link').click();
}
if (fixmystreet.page == 'new') {
- return false;
+ return;
}
$.getJSON('/report/new/ajax', {
latitude: $('#fixmystreet\\.latitude').val(),
@@ -423,31 +415,7 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
$('#form_category').change( form_category_onchange );
}
});
- return lonlat;
- },
-
- locate_report_mobile: function(e) {
- var lonlat = this.locate_report_pin_and_council(e);
- if (!lonlat) {
- return;
- }
- fixmystreet.page = 'new';
- location.hash = 'report';
- $('#sub_map_links').hide();
- $('#map_box').append(
- '<p id="mob_sub_map_links">'+
- '<a href="#">Try again</a>'+
- '<a href="#ok" id="mob_ok">OK</a>'+
- '</p>'
- );
- $('.mobile-map-banner').text('Right place?');
- },
- locate_report: function(e) {
- var lonlat = this.locate_report_pin_and_council(e);
- if (!lonlat) {
- return;
- }
$('#side-form, #site-logo').show();
/* For some reason on IOS5 if you use the jQuery show method it
* doesn't display the JS validation error messages unless you do this
@@ -479,6 +447,17 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
}
}
+ if ($('html').hasClass('mobile')) {
+ $('#sub_map_links').hide();
+ $('#map_box').append(
+ '<p id="mob_sub_map_links">' +
+ '<a href="#">Try again</a>' +
+ '<a href="#ok" id="mob_ok">OK</a>' +
+ '</p>'
+ );
+ $('.mobile-map-banner').text('Right place?');
+ }
+
fixmystreet.page = 'new';
location.hash = 'report';
}