mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
feat: add a new hook to override generateUrl in navigator.js
This commit is contained in:
@@ -441,7 +441,13 @@ define('navigator', [
|
||||
function generateUrl(index) {
|
||||
const pathname = window.location.pathname.replace(config.relative_path, '');
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user