diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-03-03 01:25:55 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-03-03 01:25:55 +0000 |
commit | ad5173beb2cfdf9e3c2a746d088f0e068c29d775 (patch) | |
tree | 2a929c09b074614af5b3e1b1d7c6b5d575f06217 /web/js/map-OpenLayers.js | |
parent | 222f7acba38a17219de0bf190daece52ccf54d8c (diff) |
Change map button back to OK if used, as otherwise use of try again was forced potentially unnecessarily.
Diffstat (limited to 'web/js/map-OpenLayers.js')
-rw-r--r-- | web/js/map-OpenLayers.js | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 92ced9981..2f5947193 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -478,20 +478,19 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { $('.mobile-map-banner').text('Right place?'); // mobile user clicks 'ok' on map - $('#mob_ok').on('click', function(e){ - e.preventDefault(); + $('#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 - if($(this).parent().hasClass('map_complete')){ - $('html, body').animate({scrollTop:0}, 1000); - }else{ - $('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'); - }); - } + $('html, body').animate({ scrollTop: height-60 }, 1000, function(){ + $('#mob_sub_map_links').addClass('map_complete'); + $('#mob_ok').text('MAP'); + }); + }, function(){ + $('html, body').animate({ scrollTop: 0 }, 1000, function(){ + $('#mob_sub_map_links').removeClass('map_complete'); + $('#mob_ok').text('OK'); + }); }); } |