File: /var/www/studis.kauko.lt/wp-content/uploads/custom-css-js/1317.js
<!-- start Simple Custom CSS and JS -->
<script type="text/javascript">
document.addEventListener('click', function(e){
const link = e.target.closest('.lang-switcher__list > li.current-lang > a');
if (!link) return;
const root = link.closest('.lang-switcher');
if (!root) return;
// jei dar neatidarytas – atidarom ir stabdom navigaciją
if (!root.classList.contains('is-open')) {
e.preventDefault();
root.classList.add('is-open');
// uždaryti paspaudus bet kur kitur
document.addEventListener('click', function closeOnce(ev){
if (!root.contains(ev.target)) root.classList.remove('is-open');
document.removeEventListener('click', closeOnce);
});
}
});
</script>
<!-- end Simple Custom CSS and JS -->