From 45fe0e11442617367568d88cd02b6559caefcba1 Mon Sep 17 00:00:00 2001 From: bruno Date: Mon, 5 Feb 2024 21:25:41 +0100 Subject: [PATCH] run ajax after loaded --- assets/script.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/script.js b/assets/script.js index 2f0e1fd..a48353d 100644 --- a/assets/script.js +++ b/assets/script.js @@ -145,7 +145,7 @@ function logout() { } function initAjax() { - let links = document.querySelectorAll('.navsite_link, .navpage_link'); + let links = document.querySelectorAll('.navsite_item, .navpage_item'); // Add click event listener to each link links.forEach(function (link) { @@ -153,8 +153,8 @@ function initAjax() { e.preventDefault(); // Get page and site information - let page = this.closest('.navpage_item').dataset.page; - let site = this.closest('.navsite_item').dataset.site; + let site = this.dataset.site; + let page = this.dataset.page; if (site && page) { navigateTo(site, page);