Skip to content

Commit

Permalink
fix: stay on page after version switch
Browse files Browse the repository at this point in the history
Signed-off-by: Farshid Tavakolizadeh <farshid.tavakolizadeh@canonical.com>
  • Loading branch information
farshidtz committed Jan 28, 2022
1 parent 8d78edd commit 6653e8f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs_src/assets/javascripts/version-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}/`);
}
});

Expand Down

0 comments on commit 6653e8f

Please sign in to comment.