aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-03-01 15:40:39 +0000
committerMatthew Somerville <matthew@mysociety.org>2012-03-01 15:40:39 +0000
commite56fd090eeb9667c90b9709dfa0c8045a45f27e2 (patch)
tree7d9f4c7d934bbef4dcf167aaa5ab4d915604c7aa /web
parentd6d3a2904cafa7236b5426a9d19f0807c28e153f (diff)
Better way of fixing size of map, and hide URL bar, fixes #266 (not sure we'll keep it though).
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index cdf1c6af7..f97476910 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -84,7 +84,9 @@ $(function(){
// Immediately go full screen map if on around page
$('#site-header').hide();
$('#map_box').prependTo('.wrapper').css({
- height: $(window).height(),
+ position: 'absolute',
+ top: 0, left: 0, right: 0, bottom: 0,
+ height: 'auto',
margin: 0
});
$('.big-green-banner')
@@ -371,3 +373,14 @@ $(function(){
}
});
});
+
+// Hide URL bar
+$(window).load(function(){
+ window.setTimeout(function(){
+ var s = window.pageYOffset || document.compatMode === "CSS1Compat" && document.documentElement.scrollTop || document.body.scrollTop || 0;
+ if (s < 20 && !location.hash) {
+ window.scrollTo(0, 1);
+ }
+ }, 0);
+});
+