exit favorites list when clicking outside

This commit is contained in:
SpikeHD 2022-04-20 23:14:39 -07:00
parent ddca421b29
commit 6d21948c37

View File

@ -17,6 +17,15 @@ document.addEventListener('DOMContentLoaded', async () => {
if (ipArr.includes(config.lastConnect)) {
document.querySelector('#star').src = 'icons/star_filled.svg'
}
// Exit favorites list when clicking outside of it
window.addEventListener("click", function() {
const favList = document.querySelector('#ipList')
if (favList.style.display !== 'none') {
favList.style.display = 'none'
}
});
})
async function getFavIps() {