aboutsummaryrefslogtreecommitdiffstats
path: root/www/js/map-OpenLayers.js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-11-07 13:21:10 +0000
committerStruan Donald <struan@exo.org.uk>2012-11-07 13:21:10 +0000
commita22e2115d4426db8a86519823453ee9e0e0845ab (patch)
treedb610f1438383f2689042d06a5f6bbfb9f5dbdab /www/js/map-OpenLayers.js
parentf321969ffaa13d275024a499eaa79bce1e19fad7 (diff)
bit of a tidy up of some old code
Diffstat (limited to 'www/js/map-OpenLayers.js')
-rw-r--r--www/js/map-OpenLayers.js35
1 files changed, 4 insertions, 31 deletions
diff --git a/www/js/map-OpenLayers.js b/www/js/map-OpenLayers.js
index 57fb9e9..a25e43f 100644
--- a/www/js/map-OpenLayers.js
+++ b/www/js/map-OpenLayers.js
@@ -206,7 +206,9 @@ function fixmystreet_onload() {
}
});
- fixmystreet.map.addControl( new OpenLayers.Control.Crosshairs(null) );
+ if (fixmystreet.page == 'around' ) {
+ fixmystreet.map.addControl( new OpenLayers.Control.Crosshairs(null) );
+ }
}
OpenLayers.Map.prototype.getCurrentSize = function() {
var mapDiv = $(this.div);
@@ -241,35 +243,6 @@ function ensureNonZeroHeight(containerid) {
}
}
-$(document).delegate('#submit-problem', 'pageshow', function(event) {
- $('#mapForm').submit(postReport);
- $('#mapForm :input[type=submit]').on('click', function() { submit_clicked = $(this); });
- $('#side-form, #site-logo').show();
- $('#pc').val(localStorage.pc);
- $('#fixmystreet\\.latitude').val(localStorage.latitude);
- $('#fixmystreet\\.longitude').val(localStorage.longitude);
- if ( !localStorage.offline ) {
- $.getJSON( CONFIG.FMS_URL + 'report/new/ajax', {
- latitude: $('#fixmystreet\\.latitude').val(),
- longitude: $('#fixmystreet\\.longitude').val()
- }, function(data) {
- if (data.error) {
- // XXX If they then click back and click somewhere in the area, this error will still show.
- $('#side-form').html('<h1>Reporting a problem</h1><p>' + data.error + '</p>');
- return;
- }
- $('#councils_text').html(data.councils_text);
- $('#form_category_row').html(data.category);
- });
- } else {
- $('#councils_text').html("You are currently operating in offline mode so you can save the details of the problem but you'll need to finish reporting when you have internet access.");
- $('#form_category_row').hide();
- $('#email_label').hide();
- $('#form_email').hide();
- $('#form_sign_in').hide();
- }
-});
-
function show_map(event) {
ensureNonZeroHeight();
@@ -514,7 +487,7 @@ OpenLayers.Format.FixMyStreet = OpenLayers.Class(OpenLayers.Format.JSON, {
});
/* Click handler */
-OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
+OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
defaultHandlerOptions: {
'single': true,
'double': false,