diff --git a/web/assets/js/main.js b/web/assets/js/main.js index cc06519..c1f67ba 100644 --- a/web/assets/js/main.js +++ b/web/assets/js/main.js @@ -22,12 +22,15 @@ const file_links = Array.from(document.getElementsByTagName("tbody")[0].children if (localStorage.getItem('audio_volume') == null) localStorage['audio_volume'] = 0.5; +function overlay_close() { + overlay_content.children[0].remove(); + overlay.style.visibility = "hidden"; + g_scale = 1; +} + overlay.addEventListener("mouseup", e => { if (e.target.tagName !== "DIV") return; - if (e.button === 0) { - overlay_content.children[0].remove(); - overlay.style.visibility = "hidden"; - g_scale = 1; } }); + if (e.button === 0) overlay_close(); }); function determine_media_element(path) {