diff options
| author | Eltrac <hi@guhub.cn> | 2025-10-13 09:17:34 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-10-13 09:17:34 +0800 |
| commit | 78326befa551cb018b534aa1f38a9870e18c3943 (patch) | |
| tree | 87c80e0587bf3e11fe5e3ebe194d01301df4f42a /layouts/_partials/scripts | |
| parent | 82e30db5b6d3da6a00e3f9725ba06e5ab51c3ecc (diff) | |
refactor: move comment toggle script to modular partial
Former-commit-id: ab28dbf17de72a0caff664a7437d8f6af86d198b
Diffstat (limited to 'layouts/_partials/scripts')
| -rw-r--r-- | layouts/_partials/scripts/action-menu-js.html | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/layouts/_partials/scripts/action-menu-js.html b/layouts/_partials/scripts/action-menu-js.html index df1c498c..dca99369 100644 --- a/layouts/_partials/scripts/action-menu-js.html +++ b/layouts/_partials/scripts/action-menu-js.html @@ -3,7 +3,6 @@ /** * ================= * Initialize all Action Menu features - * - comment toggle * - comment count * - like * ================= @@ -11,39 +10,6 @@ /** * ================= - * Toggle Comment Section - * ================= - */ - -function initializeComments() { - const commentsToggle = document.getElementById('comments-toggle'); - const commentsSection = document.getElementById('comments-section'); - - if (!commentsToggle || !commentsSection) return; - - // click on toggle - commentsToggle.addEventListener('click', function() { - const isHidden = commentsSection.classList.contains('hidden'); - const entranceAnimation = 'animate-slide-in-down'; - const exitAnimation = 'animate-slide-out-up'; - - if (isHidden) { - // swtich on - commentsSection.classList.remove('hidden', exitAnimation); - commentsSection.classList.add(entranceAnimation); - } else { - // switch off - commentsSection.classList.remove(entranceAnimation); - commentsSection.classList.add(exitAnimation); - setTimeout(() => { - commentsSection.classList.add('hidden'); - }, 200); - } - }); -} - -/** - * ================= * Fetch and set Comment Count * ================= */ @@ -196,7 +162,6 @@ function initializeFeatures() { const pageId = "{{ $pageId }}"; if (!pageId) return; - initializeComments(); initializeLikes(pageId); initializeCommentCount(); } |
