Fix bug where setHeights wouldn't account for filterInput nor the margin of ul#windows

This commit is contained in:
Nick Krichevsky 2015-02-26 18:51:43 -05:00
parent 06f5a3fd94
commit 2a2839837d

View file

@ -269,10 +269,19 @@ function setHeights(){
var windows = document.getElementById("windows");
var body = document.querySelector("body");
var html = document.querySelector("html");
var height = windows.offsetHeight+"px";
if (windows.offsetHeight>=600){
height = "600px";
var filterInput = document.getElementById("search");
var height = windows.offsetHeight+filterInput.offsetHeight;
var style = getComputedStyle(windows);
if (style.marginTop.length>0){
height+=parseInt(style.marginTop);
}
if (style.marginBottom.length>0){
height+=parseInt(style.marginBottom);
}
if (height>=600){
height = 600;
}
height+="px";
html.style.height = height;
body.style.height = height;
}