mirror of
https://github.com/welpo/tabi.git
synced 2025-12-14 11:48:45 +01:00
Add passive event listeners to search
This commit is contained in:
parent
3da2ce9c66
commit
5dd38c8b6c
2 changed files with 4 additions and 4 deletions
|
|
@ -2685,7 +2685,7 @@ window.onload = function () {
|
|||
event.stopPropagation(); // Prevents tapping through the modal.
|
||||
}
|
||||
searchModal.addEventListener('click', handleModalInteraction);
|
||||
searchModal.addEventListener('touchend', handleModalInteraction);
|
||||
searchModal.addEventListener('touchend', handleModalInteraction, {passive: true});
|
||||
|
||||
// Close modal when pressing escape.
|
||||
document.addEventListener('keydown', function (event) {
|
||||
|
|
@ -2710,7 +2710,7 @@ window.onload = function () {
|
|||
// Clicking/tapping the search button opens the modal.
|
||||
searchButton.addEventListener('mouseover', loadSearchIndex);
|
||||
searchButton.addEventListener('click', openSearchModal);
|
||||
searchButton.addEventListener('touchstart', openSearchModal);
|
||||
searchButton.addEventListener('touchstart', openSearchModal, {passive: true});
|
||||
|
||||
let searchIndexPromise = null;
|
||||
function loadSearchIndex() {
|
||||
|
|
@ -3105,7 +3105,7 @@ window.onload = function () {
|
|||
resultDivs.forEach((div) => {
|
||||
// Remove existing listener to avoid duplicates.
|
||||
div.removeEventListener('touchstart', handleTouchStart);
|
||||
div.addEventListener('touchstart', handleTouchStart);
|
||||
div.addEventListener('touchstart', handleTouchStart, {passive: true});
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
2
static/js/searchElasticlunr.min.js
vendored
2
static/js/searchElasticlunr.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue