Skip to content

Commit

Permalink
fix resize
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Pesce committed Feb 15, 2024
1 parent 3e24c7a commit cf8302b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions frontend/src/hex/HexView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
overflow: hidden;
justify-content: space-around;
min-height: calc(100% - 6em);
max-height: calc(100% - 6em);
}
.hbox {
Expand Down Expand Up @@ -104,12 +105,10 @@
})();
async function searchHex(query, options) {
console.log("searching");
return await $selectedResource.search_data(query, options);
}
async function getNewData() {
console.log("get new data");
$dataLength = await dataLenPromise;
start = $currentPosition;
end = Math.min(start + $screenHeight, $dataLength);
Expand Down Expand Up @@ -139,7 +138,6 @@
$: updateData($currentPosition, $selectedResource);
function updateData() {
console.log("update data");
chunkDataPromise = dataLenPromise
.then((length) => {
if (length < 1024 * 1024 * 64 && $selectedResource) {
Expand Down Expand Up @@ -272,13 +270,10 @@
}
function refreshHeight() {
hexDisplay = document.getElementById("hex-display");
$screenHeight =
Math.floor(hexDisplay.offsetHeight / lineHeight) * alignment;
console.log("refresh height");
console.log($screenHeight);
console.log(hexDisplay.offsetHeight);
console.log(hexDisplay.clientHeight);
console.log(hexDisplay.scrollHeight);
updateData();
}
onMount(() => {
Expand All @@ -287,6 +282,7 @@
});
</script>
<svelte:window on:resize="{refreshHeight}" />
<SearchBar
search="{searchHex}"
liveUpdate="{false}"
Expand Down

0 comments on commit cf8302b

Please sign in to comment.