Fix bug where setHeights wouldn't account for filterInput nor the margin of ul#windows
This commit is contained in:
parent
06f5a3fd94
commit
2a2839837d
15
popup.js
15
popup.js
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue