summaryrefslogtreecommitdiff
path: root/searx/static/themes/simple/src/js/main
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2025-01-16 17:10:12 +0100
committerMarkus Heiser <markus.heiser@darmarIT.de>2025-01-20 13:52:43 +0100
commit601ffcb8a32a6e2f252cebffa6a7e6f024c8e943 (patch)
tree60514c240e1e88aa7c70988f91d31b8234627acf /searx/static/themes/simple/src/js/main
parentd9115b8d48e4f421a29f5011ae3959f0171d9bf3 (diff)
[mod] add swipe events to the image gallery (gesture control)
Adds [1] to the searxng.min.js and horizontal swipe events to the image gallery. [1] https://www.npmjs.com/package/swiped-events Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'searx/static/themes/simple/src/js/main')
-rw-r--r--searx/static/themes/simple/src/js/main/results.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/searx/static/themes/simple/src/js/main/results.js b/searx/static/themes/simple/src/js/main/results.js
index 28f978a1a..ed40086ca 100644
--- a/searx/static/themes/simple/src/js/main/results.js
+++ b/searx/static/themes/simple/src/js/main/results.js
@@ -113,6 +113,17 @@
if (!window.location.hash) searxng.closeDetail();
});
+ d.querySelectorAll('.swipe-horizontal').forEach(
+ obj => {
+ obj.addEventListener('swiped-left', function (e) {
+ searxng.selectNext(false);
+ });
+ obj.addEventListener('swiped-right', function (e) {
+ searxng.selectPrevious(false);
+ });
+ }
+ );
+
w.addEventListener('scroll', function () {
var e = d.getElementById('backToTop'),
scrollTop = document.documentElement.scrollTop || document.body.scrollTop,