aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js28
-rw-r--r--web/cobrands/sass/_base.scss10
-rw-r--r--web/js/map-OpenLayers.js4
-rw-r--r--web/js/map-google.js4
-rw-r--r--web/js/map-wmts-zurich.js4
5 files changed, 36 insertions, 14 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index 48ae83103..adb935708 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -1285,9 +1285,13 @@ fixmystreet.update_pin = function(lonlat, savePushState) {
if (savePushState !== false) {
if ('pushState' in history) {
var newReportUrl = '/report/new?longitude=' + lonlats.url.lon + '&latitude=' + lonlats.url.lat;
- history.pushState({
- newReportAtLonlat: lonlats.state
- }, null, newReportUrl);
+ var newState = { newReportAtLonlat: lonlats.state };
+ // If we're already in the reporting place, we want to replace state, it's a pin move
+ if (fixmystreet.page === 'new') {
+ history.replaceState(newState, null, newReportUrl);
+ } else {
+ history.pushState(newState, null, newReportUrl);
+ }
}
}
@@ -1455,6 +1459,9 @@ fixmystreet.display = {
height = $map_box.height();
$map_box.append(
'<p class="sub-map-links" id="mob_sub_map_links">' +
+ '<a href="#" id="problems_nearby">' +
+ translation_strings.back +
+ '</a>' +
'<a href="#" id="try_again">' +
translation_strings.try_again +
'</a>' +
@@ -1467,25 +1474,32 @@ fixmystreet.display = {
width: width,
height: height
});
- $('#try_again').click(function(e){
+
+ $('.mobile-map-banner span').text(translation_strings.right_place);
+
+ $('#problems_nearby').click(function(e){
e.preventDefault();
history.back();
});
- $('.mobile-map-banner span').text(translation_strings.right_place);
+ $('#try_again').click(function(e) {
+ e.preventDefault();
+ $('#mob_ok').click();
+ });
// mobile user clicks 'ok' on map
$('#mob_ok').toggle(function(){
//scroll the height of the map box instead of the offset
//of the #side-form or whatever as we will probably want
//to do this on other pages where #side-form might not be
- $('html, body').animate({ scrollTop: height-60 }, 1000, function(){
+ $('html, body').animate({ scrollTop: height-60 }, 500, function(){
$('html').removeClass('only-map');
$('#mob_sub_map_links').addClass('map_complete');
$('#mob_ok').text(translation_strings.map);
});
}, function(){
- $('html, body').animate({ scrollTop: 0 }, 1000, function(){
+ var current = $('html, body').scrollTop();
+ $('html, body').animate({ scrollTop: 0 }, 500/height*current, function(){
$('html').addClass('only-map');
$('#mob_sub_map_links').removeClass('map_complete');
$('#mob_ok').text(translation_strings.ok);
diff --git a/web/cobrands/sass/_base.scss b/web/cobrands/sass/_base.scss
index bdd292e06..b52b75f43 100644
--- a/web/cobrands/sass/_base.scss
+++ b/web/cobrands/sass/_base.scss
@@ -1816,11 +1816,16 @@ html.js #map .noscript {
}
}
+ #problems_nearby,
#try_again,
#mob_ok {
width: 50%;
}
+ #try_again {
+ display: none;
+ }
+
.feed:after {
@extend %sub-map-link-icon;
background-position: -12px 0;
@@ -1876,6 +1881,10 @@ html.js #map .noscript {
top: 30px;
background-color: rgba(#000, 0.3);
+ #problems_nearby {
+ display: none;
+ }
+
#try_again,
#mob_ok {
position: absolute;
@@ -1935,7 +1944,6 @@ html.js #map .noscript {
.map-fullscreen & {
display: block;
}
- text-transform: uppercase;
text-align: center;
font-family: $heading-font;
line-height: 1em;
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index a8aa7f096..6142b3e23 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -132,8 +132,8 @@ $.extend(fixmystreet.utils, {
new OpenLayers.Projection("EPSG:4326")
);
- var lat = transformedLonlat.lat;
- var lon = transformedLonlat.lon;
+ var lat = transformedLonlat.lat.toFixed(6);
+ var lon = transformedLonlat.lon.toFixed(6);
document.getElementById('fixmystreet.latitude').value = lat;
document.getElementById('fixmystreet.longitude').value = lon;
diff --git a/web/js/map-google.js b/web/js/map-google.js
index bf9909f02..fc515b9dd 100644
--- a/web/js/map-google.js
+++ b/web/js/map-google.js
@@ -11,8 +11,8 @@ fixmystreet.maps = {};
(function() {
fixmystreet.maps.update_pin = function(lonlat) {
- var lat = lonlat.lat();
- var lon = lonlat.lng();
+ var lat = lonlat.lat().toFixed(6);
+ var lon = lonlat.lng().toFixed(6);
document.getElementById('fixmystreet.latitude').value = lat;
document.getElementById('fixmystreet.longitude').value = lon;
return {
diff --git a/web/js/map-wmts-zurich.js b/web/js/map-wmts-zurich.js
index 436dca6ff..7ed7bbbc3 100644
--- a/web/js/map-wmts-zurich.js
+++ b/web/js/map-wmts-zurich.js
@@ -102,8 +102,8 @@ fixmystreet.maps.matrix_ids = [
(function() {
function pin_dragged(lonlat) {
- document.getElementById('fixmystreet.latitude').value = lonlat.y;
- document.getElementById('fixmystreet.longitude').value = lonlat.x;
+ document.getElementById('fixmystreet.latitude').value = lonlat.y.toFixed(6);
+ document.getElementById('fixmystreet.longitude').value = lonlat.x.toFixed(6);
}
$(function(){