mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-18 11:46:07 +00:00
20 lines
480 B
JavaScript
20 lines
480 B
JavaScript
/*
|
|
* Citizen - Search focus JS
|
|
* https://starcitizen.tools
|
|
*
|
|
* Focus on search input when checkbox is toggled
|
|
* TODO: Clean up all the JS files after the skin is converted to Mustache
|
|
*/
|
|
|
|
var searchToggle = document.getElementById( 'search-toggle' );
|
|
|
|
function searchInputFocus() {
|
|
var searchInput = document.getElementById( 'searchInput' );
|
|
|
|
if ( searchToggle.checked !== false ) {
|
|
searchInput.focus();
|
|
}
|
|
}
|
|
|
|
searchToggle.addEventListener( 'click', searchInputFocus );
|