This commit is contained in:
@@ -1,43 +1,43 @@
|
||||
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
if (!page || !page1 || !pagePrev1 || !pageNext1 || !page2 || !pagePrev2 || !pageNext2 || !transactionFilterForm) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const scrollToTop = function() {
|
||||
window.scrollTo(0, 0);
|
||||
};
|
||||
const incPage = function() {
|
||||
const currPage = Number(page.value);
|
||||
var nextPage = currPage
|
||||
if (currPage > 1) {
|
||||
nextPage -= 1;
|
||||
page.value = nextPage;
|
||||
transactionFilterForm.dispatchEvent(new Event('change'));
|
||||
}
|
||||
page1.textContent = nextPage;
|
||||
page2.textContent = nextPage;
|
||||
scrollToTop();
|
||||
};
|
||||
const decPage = function() {
|
||||
const currPage = Number(page.value);
|
||||
var nextPage = currPage + 1;
|
||||
page.value = nextPage;
|
||||
transactionFilterForm.dispatchEvent(new Event('change'));
|
||||
page1.textContent = nextPage;
|
||||
page2.textContent = nextPage;
|
||||
scrollToTop();
|
||||
};
|
||||
|
||||
|
||||
|
||||
pagePrev1.addEventListener("click", incPage);
|
||||
pagePrev2.addEventListener("click", incPage);
|
||||
|
||||
pageNext1.addEventListener("click", decPage);
|
||||
pageNext2.addEventListener("click", decPage);
|
||||
|
||||
console.log("initialized pagination");
|
||||
})
|
||||
// document.addEventListener("DOMContentLoaded", () => {
|
||||
// if (!page || !page1 || !pagePrev1 || !pageNext1 || !page2 || !pagePrev2 || !pageNext2 || !transactionFilterForm) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// const scrollToTop = function() {
|
||||
// window.scrollTo(0, 0);
|
||||
// };
|
||||
// const incPage = function() {
|
||||
// const currPage = Number(page.value);
|
||||
// var nextPage = currPage
|
||||
// if (currPage > 1) {
|
||||
// nextPage -= 1;
|
||||
// page.value = nextPage;
|
||||
// transactionFilterForm.dispatchEvent(new Event('change'));
|
||||
// }
|
||||
// page1.textContent = nextPage;
|
||||
// page2.textContent = nextPage;
|
||||
// scrollToTop();
|
||||
// };
|
||||
// const decPage = function() {
|
||||
// const currPage = Number(page.value);
|
||||
// var nextPage = currPage + 1;
|
||||
// page.value = nextPage;
|
||||
// transactionFilterForm.dispatchEvent(new Event('change'));
|
||||
// page1.textContent = nextPage;
|
||||
// page2.textContent = nextPage;
|
||||
// scrollToTop();
|
||||
// };
|
||||
//
|
||||
//
|
||||
//
|
||||
// pagePrev1.addEventListener("click", incPage);
|
||||
// pagePrev2.addEventListener("click", incPage);
|
||||
//
|
||||
// pageNext1.addEventListener("click", decPage);
|
||||
// pageNext2.addEventListener("click", decPage);
|
||||
//
|
||||
// console.log("initialized pagination");
|
||||
// })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user