aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosh Angell <josh@supercooldesign.co.uk>2012-03-01 13:17:40 +0000
committerJosh Angell <josh@supercooldesign.co.uk>2012-03-01 13:19:43 +0000
commit890417a33a07bc70953e30c0709868632a7d249c (patch)
tree084d10aef77178290d6adbce9b2e7ab4302d2f36
parentdfc33031a0a18d60929369d6ce44a730a9162b07 (diff)
Initial scroll event for when user clicks ok on mobile map, also altered how the Notes scroll so they use offset instead
Signed-off-by: Josh Angell <josh@supercooldesign.co.uk>
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js4
-rw-r--r--web/js/map-OpenLayers.js10
2 files changed, 12 insertions, 2 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index a9341d949..cdf1c6af7 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -268,14 +268,14 @@ $(function(){
$('.mobile .content').after('<div class="content rap-notes"></div>').hide();
$('#report-a-problem-sidebar').appendTo('.rap-notes').show().after('<a href="#" class="rap-notes-close button-left">BACK</a>');
}
- $('html, body').scrollTop(0);
+ $('html, body').scrollTop($('#report-a-problem-sidebar').offset().top);
});
$('.mobile').on('click', '.rap-notes-close', function(e){
e.preventDefault();
//hide notes, show .content
$('.mobile .content').show();
$('.rap-notes').hide();
- $('html, body').scrollTop(0);
+ $('html, body').scrollTop($('#report-a-problem-main').offset().top);
});
//move 'skip this step' link on mobile
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index 89059eae9..87400c9d8 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -456,6 +456,16 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
'</p>'
);
$('.mobile-map-banner').text('Right place?');
+
+ // mobile user clicks 'ok' on map
+ $('#mob_ok').on('click', function(e){
+ e.preventDefault();
+ //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
+ var height = $('#map_box').height();
+ $('html, body').animate({scrollTop:height}, 1000);
+ });
}
fixmystreet.page = 'new';