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