diff options
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 3 | ||||
-rw-r--r-- | web/js/map-OpenLayers.js | 17 |
2 files changed, 13 insertions, 7 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index c8422ac31..af8ad2cff 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -271,6 +271,9 @@ $(function(){ }else{ //if not, move them and show, hiding .content $('.mobile .content').after('<div class="content rap-notes"></div>').hide(); + $('.rap-notes').css({ + paddingTop: $(window).height() + }); $('#report-a-problem-sidebar').appendTo('.rap-notes').show().after('<a href="#" class="rap-notes-close button-left">BACK</a>'); } $('html, body').scrollTop($('#report-a-problem-sidebar').offset().top); diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 9d5b474f1..abee9ebfa 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -469,13 +469,16 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { //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-60}, 1000, function(){ - //add this class so we can modify the look of the links inside - $('#mob_sub_map_links').addClass('map_complete'); - $('#mob_ok').text('MAP'); - }); - + if($(this).parent().hasClass('map_complete')){ + $('html, body').animate({scrollTop:0}, 1000); + }else{ + var height = $('#map_box').height(); + $('html, body').animate({scrollTop:height-60}, 1000, function(){ + //add this class so we can modify the look of the links inside + $('#mob_sub_map_links').addClass('map_complete'); + $('#mob_ok').text('MAP'); + }); + } }); } |