I am working on replacing this jQuery code written in Typescript into Vanilla JavaScript for edit .pdf purposes. I have problem resizing the window. Replacing .outerHeight() with offsetHeight doesn't work
windowResizeHandler: () => void = () => {
let body = document.querySelector("body");
let height = parseInt(window.getComputedStyle(body).height);
//suppose there is a #header element which takes some area.
let headHeight = $("#header").outerHeight();
let rightHeight = height;
if ($("#header").is(":visible")) {
rightHeight = height - headHeight;
}
$("#right").height(rightHeight);
WebPDF.updateLayer();
HTML
<page-container>
<div id="docViewer" ref="docViewer" style="background: #dddedf;"></div>
</page-container>