|
2 | 2 | // Created by basicx-StrgV // |
3 | 3 | // https://github.com/basicx-StrgV/ // |
4 | 4 | //--------------------------------------------------// |
5 | | -// Version: 1.0.2 // |
| 5 | +// Version: 1.0.3 // |
6 | 6 | //--------------------------------------------------// |
7 | 7 | document.addEventListener("DOMContentLoaded", () => { |
8 | 8 | // Get the injection wrapper element and nav to value |
@@ -40,15 +40,21 @@ document.addEventListener("DOMContentLoaded", () => { |
40 | 40 |
|
41 | 41 | // Proceed if the new document is loaded |
42 | 42 | document.addEventListener("DOMContentLoaded", () => { |
43 | | - // Check if a value for nav to is provided |
44 | | - /*if (navToValue !== null && navTo !== null) { |
45 | | - // Wrap the original navTo function from doxygen into custom function |
46 | | - let originalNavToFunc = navTo; |
47 | | - navTo = (o, root, hash, relpath) => { |
48 | | - // Ignore the root value and parse or nav to value instead |
49 | | - originalNavToFunc(o, navToValue, hash, relpath); |
50 | | - }; |
51 | | - }*/ |
| 43 | + try { |
| 44 | + // Check if a value for nav to is provided |
| 45 | + if (navToValue !== null && navTo !== null) { |
| 46 | + // Wrap the original navTo function from doxygen into custom function |
| 47 | + let originalNavToFunc = navTo; |
| 48 | + navTo = (o, root, hash, relpath) => { |
| 49 | + // Ignore the root value and parse or nav to value instead |
| 50 | + originalNavToFunc(o, navToValue, hash, relpath); |
| 51 | + }; |
| 52 | + } |
| 53 | + } catch { |
| 54 | + console.log( |
| 55 | + "[doxygen-custom-page-injector.js] Setting the correct nav item does not work with doxygen 1.10.0 or higher" |
| 56 | + ); |
| 57 | + } |
52 | 58 |
|
53 | 59 | // Get the div that contains the content |
54 | 60 | let contentContainer = document.getElementById("doc-content"); |
|
0 commit comments