From e6a1e164b284a172ef9b8e7394157e9726a97406 Mon Sep 17 00:00:00 2001 From: Viktor Lofgren Date: Tue, 9 Jan 2024 13:38:40 +0100 Subject: [PATCH] (search) Swap swipe direction for more consistent experience --- .../search-service/src/main/resources/static/search/menu.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/services-application/search-service/src/main/resources/static/search/menu.js b/code/services-application/search-service/src/main/resources/static/search/menu.js index 5832fd36..141846ad 100644 --- a/code/services-application/search-service/src/main/resources/static/search/menu.js +++ b/code/services-application/search-service/src/main/resources/static/search/menu.js @@ -74,10 +74,10 @@ if (window.matchMedia('(pointer: coarse)').matches) { } if (touchEndX - touchStartX > swipeThreshold) { - showMenu(); + hideMenu(); event.stopPropagation(); } else if (touchStartX - touchEndX > swipeThreshold) { - hideMenu(); + showMenu(); event.stopPropagation(); } }); @@ -86,6 +86,6 @@ if (window.matchMedia('(pointer: coarse)').matches) { // Add a floating panel to the bottom of the page to show a message when the filters are hidden const floatingPanel = document.createElement('div'); floatingPanel.setAttribute('style', 'position: fixed; bottom: 0; left: 0; right: 0; background-color: #fff; padding: 1em; text-align: center; display: block; border-top: 1px solid #ccc; box-shadow: 0 0 -5px #eee;'); - floatingPanel.innerHTML = '← right/left open/close the filters →'; + floatingPanel.innerHTML = '← swipe left to open filters ←'; document.body.appendChild(floatingPanel); } \ No newline at end of file