1
0

Make prev an next buttons to ignore hidden rows.

This commit is contained in:
Alexander Andreev 2022-10-18 22:22:04 +04:00
parent ed17b83aae
commit d29eb84c3f
Signed by: Arav
GPG Key ID: 0388CC8FAA51063F

View File

@ -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 => {