diff options
author | Josh Angell <josh@supercooldesign.co.uk> | 2012-03-01 16:35:07 +0000 |
---|---|---|
committer | Josh Angell <josh@supercooldesign.co.uk> | 2012-03-01 16:35:07 +0000 |
commit | d180953fab70128ce1e8215d98177456482d6051 (patch) | |
tree | 75a64a8c2f2529bc66cbf8667b35a54461318c1c /web/js/map-OpenLayers.js | |
parent | 008a592f0a599f0af7ccc1358e3c921e836587bf (diff) |
Add scroll to top js when map is completed on mobile
Signed-off-by: Josh Angell <josh@supercooldesign.co.uk>
Diffstat (limited to 'web/js/map-OpenLayers.js')
-rw-r--r-- | web/js/map-OpenLayers.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 3a6cec3e5..414bb1fc5 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -469,8 +469,12 @@ 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); + 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); + } //add this class so we can modify the look of the links inside $('#mob_sub_map_links').addClass('map_complete'); |