(search) Swap swipe direction for more consistent experience

This commit is contained in:
Viktor Lofgren 2024-01-09 13:38:40 +01:00
parent e4f8f81e89
commit e6a1e164b2

View File

@ -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);
}