Add body listener for trigger closing language box
This commit is contained in:
parent
10b545bb86
commit
270a135fca
@ -5,6 +5,12 @@ if(!isMobile()) {
|
||||
languageSelector = document.getElementsByClassName("language-selector-actual")[0];
|
||||
moreLanguagesContainer = document.getElementsByClassName("language-selector-more")[0];
|
||||
|
||||
document.body.addEventListener("click", () => {
|
||||
if (moreLanguagesContainer && !moreLanguagesContainer.classList.contains("hidden")) {
|
||||
moreLanguagesContainer.classList.add("hidden");
|
||||
}
|
||||
});
|
||||
|
||||
languageSelector && languageSelector.addEventListener("click", e => {
|
||||
e.stopPropagation();
|
||||
moreLanguagesContainer.classList.toggle("hidden");
|
||||
|
Loading…
Reference in New Issue
Block a user