aboutsummaryrefslogtreecommitdiff
path: root/static
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2024-03-15 17:36:55 +0100
committerAlex Auvolat <alex@adnab.me>2024-03-15 17:36:55 +0100
commit4cd9081dc3a41594174480c1565fd2427550c50a (patch)
tree8a09db13b11477eaba40fa1a12347015738a5f8d /static
parentf6a778698b8f0b709a7afa693ab42f8a0c314fe7 (diff)
downloaddatagengo-4cd9081dc3a41594174480c1565fd2427550c50a.tar.gz
datagengo-4cd9081dc3a41594174480c1565fd2427550c50a.zip
reduce memory usage & fix scroll to top
Diffstat (limited to 'static')
-rw-r--r--static/script.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/static/script.js b/static/script.js
index 639e743..10db48c 100644
--- a/static/script.js
+++ b/static/script.js
@@ -37,6 +37,10 @@ function display_example(i) {
}
}
+function scrollTop() {
+ window.scrollTo(0, 0);
+}
+
function spacebar() {
if (revealed) {
console.log("Next item");
@@ -46,5 +50,5 @@ function spacebar() {
$("#gen_section").removeClass("gen_hidden");
revealed = true;
}
- window.scrollTo(0, 0);
+ window.setTimeout(scrollTop, 1);
}