Skip to content

Commit

Permalink
Fix for long trees
Browse files Browse the repository at this point in the history
  • Loading branch information
tomodwyer committed Sep 3, 2024
1 parent aa99d52 commit ffb5f9a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion airlock/templates/file_browser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

{% block full_width_content %}
<div class="grid grid-cols-4 gap-x-4 flex-1">
<div class="border-r border-t bg-white overflow-auto">
<div class="border-r border-t bg-white overflow-auto" id="tree-container">
<ul
class="tree root tree__root"
hx-boost="true"
Expand Down
9 changes: 9 additions & 0 deletions assets/src/scripts/_resizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ function setBrowserHeight() {
}
}

function setTreeHeight() {
const iframe = document.getElementById("tree-container");
if (iframe) {
const iframeTop = iframe.getBoundingClientRect()["top"];
iframe.style.height = `${window.innerHeight - iframeTop}px`;
}
}

if (document.getElementById("selected-contents")) {
document.documentElement.classList.remove("min-h-screen");
document.documentElement.classList.add("h-screen");
Expand All @@ -15,6 +23,7 @@ if (document.getElementById("selected-contents")) {

new ResizeObserver(() => {
setBrowserHeight();
setTreeHeight();
}).observe(document.documentElement);
}

Expand Down

0 comments on commit ffb5f9a

Please sign in to comment.