Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
add version check on installation guide
Browse files Browse the repository at this point in the history
  • Loading branch information
ys2843 committed Jun 18, 2020
1 parent 9591436 commit 03f7534
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/static_site/src/assets/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
*/

$(document).ready(function () {
const dropdownVersions = $("#version-dropdown-container ul li")
.toArray()
.map((li) => li.innerText);

function label(lbl) {
lbl = lbl.replace(/[ .]/g, '-').toLowerCase();

Expand All @@ -33,6 +37,9 @@ $(document).ready(function () {
let searchParams = searchString.substring(1).split("&");
searchParams.forEach(function (element) {
kvPair = element.split("=");
if (kvPair[0] === 'version' && dropdownVersions.indexOf(kvPair[1]) == -1) {
kvPair[1] = dropdownVersions[0];
}
searchDict.set(kvPair[0], kvPair[1]);
});
return searchDict;
Expand Down

0 comments on commit 03f7534

Please sign in to comment.