frontend: fix event log buttons

This commit is contained in:
Hay1tsme 2024-07-06 23:20:04 -04:00
parent c65c71e89e
commit d7e8c9b490

View File

@ -46,7 +46,11 @@ var per_page = 0;
var page = 0; var page = 0;
function update_tbl() { function update_tbl() {
if (TBL_DATA.length == 0) { return; } if (TBL_DATA.length == 0) {
document.getElementById("btn_next").disabled = true;
document.getElementById("btn_prev").disabled = true;
return;
}
var tbl = document.getElementById("tbl_events"); var tbl = document.getElementById("tbl_events");
for (var i = 0; i < per_page; i++) { for (var i = 0; i < per_page; i++) {
@ -183,7 +187,7 @@ function chg_page(num) {
document.getElementById("btn_prev").disabled = true; document.getElementById("btn_prev").disabled = true;
return; return;
} else if (page == 0) { } else if (page == 0) {
document.getElementById("btn_next").disabled = false; document.getElementById("btn_next").disabled = TBL_DATA.length == 0;
document.getElementById("btn_prev").disabled = true; document.getElementById("btn_prev").disabled = true;
} else { } else {
document.getElementById("btn_next").disabled = false; document.getElementById("btn_next").disabled = false;