mirror of
https://github.com/StarCitizenTools/mediawiki-skins-Citizen.git
synced 2024-11-18 11:46:07 +00:00
19 lines
484 B
JavaScript
19 lines
484 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('search-input');
|
|
|
|
if (searchToggle.checked !== false) {
|
|
searchInput.focus();
|
|
}
|
|
}
|
|
|
|
searchToggle.addEventListener("click", searchInputFocus); |