@@ -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 |
@@ -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 |