This commit is contained in:
f4ilji
2025-01-09 13:26:14 +05:00
parent 7fb6b482b7
commit fb2bfc2924
2 changed files with 50 additions and 23 deletions
+15 -15
View File
@@ -29,20 +29,20 @@ export const linksReform = {
this.clearBodyStyles();
// 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,
// });
// });
// });
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,
});
});
});
}
};