replaces the old relative paths inside the content html with absolute paths that use the new app_root path

This commit is contained in:
SimonGschnell
2025-01-15 09:45:03 +01:00
parent 516554c1e3
commit cf57fe5086
@@ -99,6 +99,13 @@ export default {
FHC_JS_DATA_STORAGE_OBJECT.app_root
);
});
document.querySelectorAll("[href]").forEach((el) => {
let original_href = el.getAttribute("href");
// replaces the old relative paths with the new app_root path
if (original_href.match(/^\.\.\/index\.ci\.php/)){
el.href = original_href.replace(/^\.\.\/index\.ci\.php\//,FHC_JS_DATA_STORAGE_OBJECT.app_root);
}
});
},
template: /*html*/ `
<!-- div that contains the content -->