Parcourir la source

Filter/display search results on typeahead

master
David Larlet il y a 2 ans
Parent
révision
96263c98da
2 fichiers modifiés avec 18 ajouts et 18 suppressions
  1. 9
    9
      david/recherche/index.html
  2. 9
    9
      david/templates/recherche.html

+ 9
- 9
david/recherche/index.html Voir le fichier

@@ -2475,7 +2475,15 @@
if (!form || !input || !resultList || !searchStatus || !searchIndex || !stopWords) return

// Create a submit handler
form.addEventListener('submit', submitHandler)
form.addEventListener('submit', function (event) {
event.preventDefault()
search(input.value)
})

// Create a typeahead handler
form.addEventListener('keyup', function (event) {
search(input.value)
})

// Create a reset handler
form.addEventListener('reset', function() {
@@ -2496,14 +2504,6 @@
search(query)
}

/**
* Handle submit events
*/
function submitHandler (event) {
event.preventDefault()
search(input.value)
}

/**
* Search for matches
* @param {String} query The term to search for

+ 9
- 9
david/templates/recherche.html Voir le fichier

@@ -168,7 +168,15 @@
if (!form || !input || !resultList || !searchStatus || !searchIndex || !stopWords) return

// Create a submit handler
form.addEventListener('submit', submitHandler)
form.addEventListener('submit', function (event) {
event.preventDefault()
search(input.value)
})

// Create a typeahead handler
form.addEventListener('keyup', function (event) {
search(input.value)
})

// Create a reset handler
form.addEventListener('reset', function() {
@@ -189,14 +197,6 @@
search(query)
}

/**
* Handle submit events
*/
function submitHandler (event) {
event.preventDefault()
search(input.value)
}

/**
* Search for matches
* @param {String} query The term to search for

Chargement…
Annuler
Enregistrer