From d56a58044dcc619f6e26674316e7c38fc8ace8c4 Mon Sep 17 00:00:00 2001
From: saucecoat <43880196+saucecoat@users.noreply.github.com>
Date: Sun, 30 Oct 2022 06:08:44 +0000
Subject: [PATCH] Added German translation (#223)
---
assets/js/semantic-search.js | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/assets/js/semantic-search.js b/assets/js/semantic-search.js
index 3cebe5a..4382817 100644
--- a/assets/js/semantic-search.js
+++ b/assets/js/semantic-search.js
@@ -15,7 +15,15 @@
return (await response.json());
}
-registerHandlers((e) => {
+function debounce(func, timeout = 200) {
+ let timer;
+ return (...args) => {
+ clearTimeout(timer)
+ timer = setTimeout(() => { func.apply(this, args); }, timeout)
+ };
+}
+
+registerHandlers(debounce((e) => {
term = e.target.value
if (term !== "") {
searchContents(term)
@@ -27,4 +35,4 @@
))
.then(results => displayResults(results))
}
-})
+}))
--
Gitblit v1.10.0