aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/fixmystreet.js
diff options
context:
space:
mode:
authorJosh Angell <josh@supercooldesign.co.uk>2012-02-14 11:36:43 +0000
committerJosh Angell <josh@supercooldesign.co.uk>2012-02-14 11:36:43 +0000
commit8c04cb49d80f52afa773c9ff5d5c9845ee40e7a7 (patch)
treeb31cacd8dfbcacc73fe0d71c8da7135b31f104e5 /web/js/fixmystreet.js
parentec39561c09d580b7861d76cee1bb4ad882a6d9d7 (diff)
Height fix js function added and used on the report/around page for the sidebar
Signed-off-by: Josh Angell <josh@supercooldesign.co.uk>
Diffstat (limited to 'web/js/fixmystreet.js')
-rw-r--r--web/js/fixmystreet.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/web/js/fixmystreet.js b/web/js/fixmystreet.js
index 1ebff1f4c..86fac3fcb 100644
--- a/web/js/fixmystreet.js
+++ b/web/js/fixmystreet.js
@@ -30,6 +30,18 @@ function form_category_onchange() {
});
}
+
+function heightFix(elem1, elem2, offset){
+ var h1 = $(elem1).height(),
+ h2 = $(elem2).height();
+ if(offset === undefined){
+ offset = 0;
+ }
+ if(h1 > h2){
+ $(elem2).css({'min-height':h1+offset});
+ }
+}
+
$(function(){
if(Modernizr.mq('only screen and (max-width:48em)')) {
$('html').addClass('mobile');
@@ -199,6 +211,7 @@ $(function(){
//desktop
if($('#report-a-poblem-sidebar:visible').length > 0){
$('.content[role=main]').addClass('report-a-poblem-page');
+ heightFix('#report-a-poblem-sidebar:visible', '.content.report-a-poblem-page', 26);
}
//hide on mobile
$('.mobile #report-a-poblem-sidebar').hide();