Skip to content

Commit

Permalink
Added workaround to make the script work with doxygen 1.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
basicx-StrgV committed Jan 18, 2024
1 parent 4852722 commit 43e09a5
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions doxygen-custom-page-injector.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Created by basicx-StrgV //
// https://github.com/basicx-StrgV/ //
//--------------------------------------------------//
// Version: 1.0.2 //
// Version: 1.0.3 //
//--------------------------------------------------//
document.addEventListener("DOMContentLoaded", () => {
// Get the injection wrapper element and nav to value
Expand Down Expand Up @@ -40,14 +40,20 @@ document.addEventListener("DOMContentLoaded", () => {

// Proceed if the new document is loaded
document.addEventListener("DOMContentLoaded", () => {
// Check if a value for nav to is provided
if (navToValue != null) {
// Wrap the original navTo function from doxygen into custom function
let originalNavToFunc = navTo;
navTo = (o, root, hash, relpath) => {
// Ignore the root value and parse or nav to value instead
originalNavToFunc(o, navToValue, hash, relpath);
};
try {
// Check if a value for nav to is provided
if (navToValue !== null && navTo !== null) {
// Wrap the original navTo function from doxygen into custom function
let originalNavToFunc = navTo;
navTo = (o, root, hash, relpath) => {
// Ignore the root value and parse or nav to value instead
originalNavToFunc(o, navToValue, hash, relpath);
};
}
} catch {
console.log(
"[doxygen-custom-page-injector.js] Setting the correct nav item does not work with doxygen 1.10.0 or higher"
);
}

// Get the div that contains the content
Expand Down

0 comments on commit 43e09a5

Please sign in to comment.