diff options
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 14 | ||||
-rw-r--r-- | web/js/map-OpenLayers.js | 10 |
2 files changed, 17 insertions, 7 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index af8ad2cff..427e2f9cc 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -261,29 +261,31 @@ $(function(){ //show/hide notes on mobile $('.mobile #report-a-problem-sidebar').after('<a href="#" class="rap-notes-trigger button-right">How to send successful reports</a>').hide(); - $('.mobile').on('click', '.rap-notes-trigger', function(e){ + $('.rap-notes-trigger').click(function(e){ e.preventDefault(); //check if we've already moved the notes if($('.rap-notes').length > 0){ //if we have, show and hide .content - $('.mobile .content').hide(); + $('.content').hide(); $('.rap-notes').show(); }else{ //if not, move them and show, hiding .content - $('.mobile .content').after('<div class="content rap-notes"></div>').hide(); + $('.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>'); + $('#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); + location.hash = 'rap-notes'; }); $('.mobile').on('click', '.rap-notes-close', function(e){ e.preventDefault(); //hide notes, show .content - $('.mobile .content').show(); + $('.content').show(); $('.rap-notes').hide(); - $('html, body').scrollTop($('#report-a-problem-main').offset().top); + $('html, body').scrollTop($('#mob_ok').offset().top); + location.hash = 'report'; }); //move 'skip this step' link on mobile diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index abee9ebfa..aec9b69b1 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -259,7 +259,15 @@ $(function(){ } $(window).hashchange(function(){ - if (location.hash) { return; } + if (location.hash == '#report' && $('.rap-notes').is(':visible')) { + $('.rap-notes-close').click(); + return; + } + + if (location.hash) { + return; + } + // Okay, back to around view. fixmystreet.bbox_strategy.activate(); fixmystreet.markers.refresh( { force: true } ); |