diff --git a/web/assets/js/main.js b/web/assets/js/main.js index 1dfb933..226588b 100644 --- a/web/assets/js/main.js +++ b/web/assets/js/main.js @@ -83,8 +83,9 @@ b_prev.addEventListener("click", e => { g_current_row = g_last_row; else g_current_row = g_current_row.previousSibling; - } while (!send_to_overlay(g_current_row.firstChild.firstChild.pathname, - determine_media_element(g_current_row.firstChild.firstChild.pathname))); + } while (g_current_row.classList.contains("hidden") + || !send_to_overlay(g_current_row.firstChild.firstChild.pathname, + determine_media_element(g_current_row.firstChild.firstChild.pathname))); e.preventDefault(); }); @@ -94,8 +95,10 @@ b_next.addEventListener("click", () => { g_current_row = g_first_row; else g_current_row = g_current_row.nextSibling; - } while (!send_to_overlay(g_current_row.firstChild.firstChild.pathname, - determine_media_element(g_current_row.firstChild.firstChild.pathname))); + + } while (g_current_row.classList.contains("hidden") + || !send_to_overlay(g_current_row.firstChild.firstChild.pathname, + determine_media_element(g_current_row.firstChild.firstChild.pathname))); }); window.addEventListener("keydown", e => {