-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
function setBrowserHeight() { | ||
const iframe = document.querySelector("iframe"); | ||
if (iframe) { | ||
const iframeTop = iframe.getBoundingClientRect()["top"]; | ||
iframe.style.height = `${window.innerHeight - iframeTop}px`; | ||
} | ||
|
||
const table = document.getElementById("selected-contents"); | ||
if (table) { | ||
const tableTop = table.getBoundingClientRect()["top"]; | ||
table.style.height = `${window.innerHeight - tableTop}px`; | ||
table.classList.add("overflow-auto"); | ||
console.log({ table }); | ||
} | ||
} | ||
|
||
function setTreeHeight() { | ||
const iframe = document.getElementById("tree-container"); | ||
if (iframe) { | ||
const iframeTop = iframe.getBoundingClientRect()["top"]; | ||
iframe.style.height = `${window.innerHeight - iframeTop}px`; | ||
} | ||
} | ||
|
||
document.documentElement.classList.remove("min-h-screen"); | ||
document.documentElement.classList.add("h-screen"); | ||
|
||
document.body.classList.remove("min-h-screen"); | ||
document.body.classList.add("h-screen"); | ||
|
||
document.querySelector("main")?.classList.add("overflow-hidden"); | ||
|
||
new ResizeObserver(() => { | ||
setBrowserHeight(); | ||
setTreeHeight(); | ||
}).observe(document.documentElement); | ||
|
||
document.body.addEventListener("htmx:afterSettle", () => { | ||
return setBrowserHeight(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters