aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-03-29 13:54:48 +0100
committerMatthew Somerville <matthew@mysociety.org>2012-03-29 13:54:48 +0100
commit1f4475f5e6e182987bc437f850e2a6be0dbf9d5e (patch)
tree36ec0f9c94a82cbdc7323758217e2e9e962cf852
parentfed45956fdc592ae73dfdf35d53b73bd4b8cbe6d (diff)
Tidy up JS a bit.
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js17
1 files changed, 11 insertions, 6 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index 7b987c55e..ce2f45314 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -104,20 +104,25 @@ $(function(){
// Make map full screen on non-mobile sizes.
$html.removeClass('mobile');
if (cobrand == 'bromley') {
+ var $window = $(window), $content = $('.content'), o = $content.offset();
if ($html.hasClass('ie6')) {
$('#map_box').prependTo('.wrapper').css({
zIndex: 0, position: 'absolute',
- right: 0, top: '4em',// left: $('.content').offset().left + $('.content').width(),
- width: $(window).width() - $('.content').offset().left - $('.content').width() - 32,
- height: $(window).height() - $('.content').offset().top + 32,
+ right: 0, top: '4em',
+ width: $window.width() - o.left - $content.outerWidth(),
+ height: $window.height() - o.top + 32,
margin: 0
});
} else {
+ var map_height = $window.height() - o.top;
+ if ($html.hasClass('ie7')) {
+ map_height += 16; // XXX
+ }
$('#map_box').prependTo('.wrapper').css({
zIndex: 0, position: 'fixed',
- right: 0, top: $('.content').offset().top, bottom: 0,// left: $('.content').offset().left + $('.content').width(),
- width: $(window).width() - $('.content').offset().left - $('.content').width() - 32,
- height: $(window).height() - $('.content').offset().top,
+ right: 0, top: o.top, bottom: 0,
+ width: $window.width() - o.left - $content.outerWidth(),
+ height: map_height,
margin: 0
});
}