Skip to content

Commit 9818aae

Browse files
committed
Fix 500 error in unfold
And undo changes accidentally committed before.
1 parent 69e1c60 commit 9818aae

File tree

4 files changed

+6
-20
lines changed

4 files changed

+6
-20
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ install:
1111
${BIN}/pip install -e .[clients]
1212
${BIN}/pip install -e .[tests]
1313
${BIN}/pip install pre-commit
14-
${BIN}/pip install -e ../jupyterlite/py/jupyterlite-core
15-
${BIN}/pip install -e ../jupyterlite/py/jupyterlite
14+
#${BIN}/pip install -e ../jupyterlite/py/jupyterlite-core
15+
#${BIN}/pip install -e ../jupyterlite/py/jupyterlite
1616

1717
assets:
1818
rm caterva2/services/static/build/*
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<input type="number" min="0" max="{{ pages - 1 }}" name="i" value="0"
2-
hx-get="{{ href }}" hx-target="#image-div" xxhx-swap="innerHTML show:top">
2+
hx-get="{{ href }}" hx-target="#image-div">
33

4-
<div hx-get="{{ href }}?i=0" hx-trigger="load" id="image-div" xxhx-preserve></div>
4+
<div hx-get="{{ href }}?i=0" hx-trigger="load" id="image-div"></div>

caterva2/services/sub.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,8 +1369,8 @@ async def unfold_file(
13691369
newsize = 0
13701370
if os.path.exists(dirname):
13711371
# Traverse the directory and get the size for all files
1372-
for _, relpath in utils.walk_files(dirname):
1373-
newsize += os.path.getsize(relpath)
1372+
for abspath, _ in utils.walk_files(dirname):
1373+
newsize += os.path.getsize(abspath)
13741374
total_size = get_disk_usage() + newsize
13751375
if total_size > settings.quota:
13761376
# Remove the directory if it exists

caterva2/services/templates/home.html

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -106,20 +106,6 @@
106106
//showAlert(ev.detail.error, "danger");
107107
}
108108
})
109-
110-
111-
document.body.addEventListener('htmx:beforeRequest', function(evt) {
112-
console.log('beforeRequest', window.scrollY);
113-
sessionStorage.setItem('scrollPosition', window.scrollY);
114-
});
115-
116-
document.body.addEventListener('htmx:afterSettle', function(evt) {
117-
const scrollPosition = sessionStorage.getItem('scrollPosition');
118-
console.log('afterSwap', window.scrollY, scrollPosition);
119-
if (scrollPosition) {
120-
window.scrollTo(0, scrollPosition);
121-
}
122-
});
123109
</script>
124110

125111
</body>

0 commit comments

Comments
 (0)