From d29eb84c3f8d24626658c92854847a9e04a060a1 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Tue, 18 Oct 2022 22:22:04 +0400 Subject: [PATCH] Make prev an next buttons to ignore hidden rows. --- web/assets/js/main.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 => {