feat: add a new hook to override generateUrl in navigator.js

This commit is contained in:
Barış Soner Uşaklı
2025-09-16 11:23:31 -04:00
parent b66c30a2a7
commit 68a8db856a

View File

@@ -441,7 +441,13 @@ define('navigator', [
function generateUrl(index) { function generateUrl(index) {
const pathname = window.location.pathname.replace(config.relative_path, ''); const pathname = window.location.pathname.replace(config.relative_path, '');
const parts = pathname.split('/'); const parts = pathname.split('/');
return parts[1] + '/' + parts[2] + '/' + parts[3] + (index ? '/' + index : ''); const newUrl = parts[1] + '/' + parts[2] + '/' + parts[3] + (index ? '/' + index : '');
const data = {
newUrl,
index,
};
hooks.fire('filter:navigator.generateUrl', data);
return data.newUrl;
} }
navigator.getCount = () => count; navigator.getCount = () => count;