This commit is contained in:
f4ilji
2024-12-24 16:20:50 +05:00
parent 5535bd6eb9
commit 5d66a2cc5a
15 changed files with 692 additions and 102 deletions
+16 -13
View File
@@ -26,20 +26,23 @@ export const linksReform = {
},
},
updated() {
const hostname = window.location.hostname;
const defaultLinks = Array.from(this.getDefaultLinks());
const reactiveLinks = this.createReactiveLinks(defaultLinks, hostname);
this.clearBodyStyles();
reactiveLinks.forEach(link => {
link.addEventListener('click', (event) => {
event.preventDefault();
this.clearBodyStyles();
const url = link.getAttribute('href');
this.$inertia.visit(url, {
preserveScroll: false,
});
});
});
// const hostname = window.location.hostname;
// const defaultLinks = Array.from(this.getDefaultLinks());
//
// const reactiveLinks = this.createReactiveLinks(defaultLinks, hostname);
//
// reactiveLinks.forEach(link => {
// link.addEventListener('click', (event) => {
// event.preventDefault();
// this.clearBodyStyles();
// const url = link.getAttribute('href');
// this.$inertia.visit(url, {
// preserveScroll: false,
// });
// });
// });
}
};