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

prevent master version for installation widget #18587

Merged
merged 1 commit into from
Jun 25, 2020
Merged
Changes from all commits
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
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