Fix issue with version 3 in docs version list (#74089)

Previously would subsitute the "3" in "s3" instead of the version location in the URL
This commit is contained in:
Scott Sinclair 2021-04-20 02:33:35 +10:00 committed by GitHub
parent 9ba6cf9a72
commit 325ccf22fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -13,10 +13,10 @@
if ( "{{ slug }}" == "{{ current_version }}" ) {
option.selected = true;
}
if (current_url.search("{{ current_version }}") > -1) {
option.value = current_url.replace("{{ current_version }}","{{ slug }}");
if (current_url.search("/{{ current_version }}/") > -1) {
option.value = current_url.replace("/{{ current_version }}/","/{{ slug }}/");
} else {
option.value = current_url.replace("latest","{{ slug }}");
option.value = current_url.replace("/latest/","/{{ slug }}/");
}
x.add(option);
</script>