add: toggle input by a click on logo

For mobile keyoard experience
This commit is contained in:
Tomasz Kapias 2023-04-28 18:05:43 +02:00
parent 7b49db4fb4
commit 5c84fe7feb

View file

@ -659,3 +659,17 @@
</main>
</div>
<script>
window.addEventListener("load", () => {
document.querySelector('#logo').addEventListener('click', () => {
if(document.querySelector('search-component').shadowRoot.querySelector('.dialog').open) {
document.querySelector('search-component').shadowRoot.querySelector('.dialog').close();
}
else {
document.querySelector('search-component').shadowRoot.querySelector('.dialog').show();
document.querySelector('search-component').shadowRoot.querySelector('.input').focus();
}
});
});
</script>