Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: stay on page after version switch (geneva) #684

Merged
merged 2 commits into from
Aug 10, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: stay on page after version switch
Signed-off-by: Farshid Tavakolizadeh <farshid.tavakolizadeh@canonical.com>
(cherry picked from commit 6653e8f)
  • Loading branch information
farshidtz committed Jan 28, 2022
commit 84314f42e4e9d66d8b20f4a18b83b77350e7b6f1
3 changes: 2 additions & 1 deletion docs_src/assets/javascripts/version-select.js
Original file line number Diff line number Diff line change
@@ -57,7 +57,8 @@ window.addEventListener("DOMContentLoaded", function () {
if (this.value === '1.1') {
window.location.href = "https://fuji-docs.edgexfoundry.org"
} else {
window.location.href = "/" + this.value;
// replace version in the beginning of path with selected version
window.location.pathname = window.location.pathname.replace(/^\/(\d.\d)\//, `/${this.value}/`);
}
});