Skip to content

Commit

Permalink
fix: version switcher on sidebar (#1342)
Browse files Browse the repository at this point in the history
Fixes #1340.  Thanks to Adam Plowman (@aplowman) for reporting.
  • Loading branch information
alphapapa committed Jun 8, 2023
1 parent dbab287 commit d6fdd8b
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,11 @@ if (themeSwitchBtns.length) {
node.dataset["versionName"] = entry.name;
node.dataset["version"] = entry.version;

document.querySelector(".version-switcher__menu").append(node);
document.querySelectorAll(".version-switcher__menu").forEach((menu) => {
// There may be multiple version-switcher elements, e.g. one
// in a slide-over panel displayed on smaller screens.
menu.append(node);
});
// replace dropdown button text with the preferred display name of
// this version, rather than using sphinx's {{ version }} variable.
// also highlight the dropdown entry for the currently-viewed
Expand Down

0 comments on commit d6fdd8b

Please sign in to comment.