| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,6 +36,16 @@ const initialiseSidebar = () => { | |||
| 36 | 36 | return | |
| 37 | 37 | } | |
| 38 | 38 | ||
| 39 | + {# Check if we need to dynamically insert the sidebar button. | ||
| 40 | + # We prefer the ``sphinx_version_tuple`` variable, and if it is undefined we | ||
| 41 | + # know we are running a Sphinx version older than 4.2. | ||
| 42 | + # | ||
| 43 | + # See: https://www.sphinx-doc.org/en/master/development/templating.html#sphinx_version_tuple | ||
| 44 | + #} | ||
| 45 | + {% if sphinx_version_tuple is defined and sphinx_version_tuple[0] >= 5 %} | ||
| 46 | + const sidebarButton = document.getElementById("sidebarbutton") | ||
| 47 | + const sidebarArrow = sidebarButton.querySelector('span') | ||
| 48 | + {% else %} | ||
| 39 | 49 | // create the sidebar button element | |
| 40 | 50 | const sidebarButton = document.createElement("div") | |
| 41 | 51 | sidebarButton.id = "sidebarbutton" | |
@@ -44,6 +54,7 @@ const initialiseSidebar = () => { | |||
| 44 | 54 | sidebarArrow.innerText = "«" | |
| 45 | 55 | sidebarButton.appendChild(sidebarArrow) | |
| 46 | 56 | sidebar.appendChild(sidebarButton) | |
| 57 | + {% endif %} | ||
| 47 | 58 | ||
| 48 | 59 | const collapse_sidebar = () => { | |
| 49 | 60 | bodyWrapper.style.marginLeft = ".8em" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments