Skip to content
Snippets Groups Projects
Commit 4d4c975f authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

Merge pull request #1694 from mozilla/issue_1693_main_site_scroll

Fix the scroll bar appearing on the main site's index page if it is not needed.
parents 99ac2669 10ce739c
No related branches found
No related tags found
No related merge requests found
...@@ -59,20 +59,35 @@ $(function() { ...@@ -59,20 +59,35 @@ $(function() {
return divHeight === 110; return divHeight === 110;
} }
function elementHeightWithMargins(element) {
element = $(element);
var height = element.outerHeight()
+ parseInt(element.css("margin-top"), 10)
+ parseInt(element.css("margin-bottom"), 10);
return height;
}
xhr.init({ time_until_delay: 10 * 1000 }); xhr.init({ time_until_delay: 10 * 1000 });
network.init(); network.init();
$(".display_always,.display_auth,.display_nonauth").hide(); $(".display_always,.display_auth,.display_nonauth").hide();
$(window).bind('resize', function() { $(window).bind('resize', function() {
var height = $(window).height() - $("header").outerHeight() - $("footer").outerHeight(); var height = $(window).height()
$("#vAlign").css({ "height": height }); // To find the height of the content, subtract the height of the
// header and footer INCLUDING any top and bottom margins they
// have. If the margins are not included, the center content
// will be too tall and a scroll bar appears.
- elementHeightWithMargins("header")
- elementHeightWithMargins("footer");
$("#vAlign").css({ "height": height });
// On the manage page, the content element sometimes does not take up the // On the manage page, the content element sometimes does not take up the
// full height of the screen, leaving the footer to float somewhere in the // full height of the screen, leaving the footer to float somewhere in the
// middle. To compensate, force the min-height of the content so that the // middle. To compensate, force the min-height of the content so that the
// footer remains at the bottom of the screen. // footer remains at the bottom of the screen.
var paddingTop = 0, paddingBottom = 0; var paddingTop = 0, paddingBottom = 0;
if(paddingAddedToMinHeight()) { if(paddingAddedToMinHeight()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment