mirror of
https://github.com/kmitresse/Cards-Rush.git
synced 2026-05-13 17:11:49 +00:00
fix - fix pagination display
This commit is contained in:
@@ -45,7 +45,7 @@
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
<nav class="pagination is-rounded" role="navigation" aria-label="pagination">
|
||||
<nav class="pagination is-rounded is-centered" role="navigation" aria-label="pagination">
|
||||
<ul class="pagination-list">
|
||||
<li><a class="pagination-previous">${translator.translate('pagination_previous')}</a></li>
|
||||
<li><a class="pagination-link pagination-current" aria-label="Goto page 1"><%=currentPage%></a></li>
|
||||
|
||||
@@ -47,22 +47,11 @@ function updatePagination(pageNumber) {
|
||||
table.appendChild(row);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// data.forEach(player => {
|
||||
// const row = document.createElement('tr');
|
||||
// row.classList.add('played-game-row');
|
||||
// row.innerHTML = `
|
||||
// <td>${player.createdDate}</td>
|
||||
// <td>${player.score}</td>
|
||||
// <td>${player.winnerUsername}</td>
|
||||
// <td><a href="${contextPath}game-statistics?id=${player.gameId}">${showLabel}</a></td>`
|
||||
// table.appendChild(row);
|
||||
// });
|
||||
})
|
||||
}
|
||||
|
||||
function updateButtons(oldPageNumber,newPageNumber) {
|
||||
console.log("oldPageNumber: " + oldPageNumber + " newPageNumber: " + newPageNumber, "nbPages: " + nbPages.value.toString())
|
||||
|
||||
if (oldPageNumber === "1") {
|
||||
paginationPrevious.classList.remove('is-disable');
|
||||
@@ -70,10 +59,11 @@ function updateButtons(oldPageNumber,newPageNumber) {
|
||||
if (newPageNumber === "1") {
|
||||
paginationPrevious.classList.add('is-disable');
|
||||
}
|
||||
if (oldPageNumber === nbPages.value.toString()) {
|
||||
if (oldPageNumber <= nbPages.value.toString()) {
|
||||
paginationNext.classList.remove('is-disable');
|
||||
}
|
||||
if (newPageNumber === nbPages.value.toString()) {
|
||||
if (newPageNumber >= nbPages.value.toString()) {
|
||||
console.log("paginationNext.classList.add('is-disable');");
|
||||
paginationNext.classList.add('is-disable');
|
||||
}
|
||||
paginationCurrent.textContent = `${newPageNumber}`;
|
||||
|
||||
Reference in New Issue
Block a user