forked from Adleraci/adlerka.top
Test JS
This commit is contained in:
parent
b698f9e284
commit
c4c9e021e4
@ -134,10 +134,17 @@ async function doPageAction(requestData, wantsReturn = false) {
|
||||
}
|
||||
}
|
||||
|
||||
async function initAjax() {
|
||||
const links = document.querySelectorAll('.navsite_link, .navpage_link');
|
||||
async function initAjaxNavigationEvents(){
|
||||
const allLinks = document.querySelectorAll('.navsite_link, .navpage_link');
|
||||
const pageLinks = document.querySelectorAll('.navpage_link');
|
||||
|
||||
links.forEach(function (link) {
|
||||
pageLinks.forEach(function (link) {
|
||||
link.addEventListener('click', function () {
|
||||
navLinks.classList.remove("active");
|
||||
});
|
||||
});
|
||||
|
||||
allLinks.forEach(function (link) {
|
||||
link.addEventListener('click', function (e) {
|
||||
e.preventDefault();
|
||||
let site = this.dataset.site;
|
||||
@ -153,6 +160,11 @@ async function initAjax() {
|
||||
toggleButton.addEventListener('click', () => {
|
||||
navLinks.classList.toggle("active")
|
||||
})
|
||||
}
|
||||
|
||||
async function initAjax() {
|
||||
|
||||
await initAjaxNavigationEvents();
|
||||
await onPageLoad();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user