_includes/section/home.html in word-games-theme-1.1.4 vs _includes/section/home.html in word-games-theme-1.1.5

- old
+ new

@@ -45,17 +45,17 @@ <option value="wwf">Enable (Words With Friends)</option> </select> </div> <div class="wrapper_dropDown d-flex justify-content-end mt-5" style="gap:15px"> - <div class="advancedFilter" style="position: relative;" onclick="myFunction()"> + <div class="advancedFilter" style="position: relative;"> <input type="button" value="Advanced Filter" class="filterButton"> <div class="angle-arrow2"></div> </div> </div> - <div class="fillterWrapper"> + <div id="fillterWrapper" class="fillterWrapper"> <div class="text-right times" style="cursor: pointer"> <img src="../../assets/images/window-close.png" alt="" width="15px"> </div> <div class="startsWith"> @@ -133,12 +133,24 @@ advancedFilter.addEventListener('click', () => { fillterWrapper.classList.toggle('actives') fillterWrapper.classList.remove('hide') }) - const close = document.querySelector('.times') - close.addEventListener('click', () => { + + + document.addEventListener('click', (event) => { + const withinBoundaries = event.composedPath().includes(advancedFilter) + if (!withinBoundaries) { + closeModal() + } + }) + function closeModal() { fillterWrapper.classList.remove('actives') fillterWrapper.classList.add('hide') + } + + const close = document.querySelector('.times') + close.addEventListener('click', () => { + closeModal() }) </script> \ No newline at end of file