mediawiki-skins-Citizen/resources/skins.citizen.search/main.js
alistair3149 b2bd79196d
feat: rework search module (#386)
* feat: rewrite search module (WIP)
There are some caveats because it is a WIP
- Messages are not i18n yet
- Missing placeholder suggestion thumbnail
- Only REST mode works
- Missing greeting message when there is no search query
- Code might look like a mess (I learned JS not long ago)

* refactor: remove old search module

* feat: clean up search suggestion styles

* feat: hide overflow for suggestion text

* feat: add action API and various cleanup

* feat: re-add abort controller

* feat: add message support and tweaks

* feat: use virtual config instead of ResourceLoader hook

* fix: missing comma in const definition

* feat: add ARIA attributes
2021-05-17 16:34:14 -04:00

15 lines
332 B
JavaScript

/**
* @return {void}
*/
function initSearchLoader() {
const searchForm = document.getElementById( 'searchform' ),
searchInput = document.getElementById( 'searchInput' );
if ( searchForm && searchInput ) {
const typeahead = require( './typeahead.js' );
typeahead.init( searchForm, searchInput );
}
}
initSearchLoader();