From 91b942456ca96e098236d01c0d66f5a0033f84aa Mon Sep 17 00:00:00 2001 From: tobi Date: Sun, 27 Apr 2025 01:12:04 +0200 Subject: [PATCH] cloding button fix --- assets/js/main.js | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/assets/js/main.js b/assets/js/main.js index 33285e7..733430c 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -396,19 +396,9 @@ $main._show(location.hash.substr(1), true); }); - // Add close button functionality - document.addEventListener('DOMContentLoaded', () => { - // Add click event listeners to all close buttons - document.querySelectorAll('.close').forEach(button => { - button.addEventListener('click', () => { - // Find the closest article element - const article = button.closest('article'); - if (article) { - // Use the existing _hide method - $main._hide(true); - } - }); - }); + // Close button functionality + $('.close').on('click', function() { + $main._hide(true); }); })(jQuery); \ No newline at end of file