Skip to content

Commit

Permalink
fix: count down
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Oct 15, 2024
1 parent e3548e0 commit 817cc02
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ <h6 class="fw-bold m-0 p-0" id="count-like">
<div class="my-2 pt-3" id="comments" data-loading="false"></div>

<!-- Pagination -->
<nav class="d-flex justify-content-center py-3 mb-4">
<nav class="d-flex d-none justify-content-center py-3 mb-4" id="pagination">
<ul class="pagination mb-0">
<li class="page-item disabled" id="previous">
<button class="page-link rounded-start-4" onclick="pagination.previous(this)">
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ <h2 class="font-esthetic text-center mb-3" style="font-size: 2.5rem;">Ucapan &am
<div class="my-3 pt-3" id="comments" data-loading="false"></div>

<!-- Pagination -->
<nav class="d-flex justify-content-center mb-0 pt-2">
<nav class="d-flex d-none justify-content-center mb-0 pt-2" id="pagination">
<ul class="pagination mb-0">
<li class="page-item disabled" id="previous">
<button class="page-link rounded-start-4" onclick="pagination.previous(this)">
Expand Down
3 changes: 2 additions & 1 deletion js/guest.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ export const guest = (() => {
};

const init = () => {
countDownDate();

if (session.isAdmin()) {
storage('user').clear();
storage('owns').clear();
Expand Down Expand Up @@ -146,7 +148,6 @@ export const guest = (() => {
}

session.guest();
countDownDate();
};

return {
Expand Down
8 changes: 8 additions & 0 deletions js/pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ export const pagination = (() => {

const enableNext = () => liNext.classList.contains('disabled') ? liNext.classList.remove('disabled') : null;

const enablePagination = () => {
const pagination = document.getElementById('pagination');
if (pagination.classList.contains('d-none')) {
pagination.classList.remove('d-none');
}
};

const buttonAction = (button) => {
button.disabled = true;
const tmp = button.innerHTML;
Expand Down Expand Up @@ -91,6 +98,7 @@ export const pagination = (() => {
}

enableNext();
enablePagination();
};

const previous = async (button) => {
Expand Down

0 comments on commit 817cc02

Please sign in to comment.