Fix docs version dropdown (#2389)

* Populate dropdown with correct URL

* Use correct version evaulation

* Remove extra code to insert current version in cases where hosting locally
This commit is contained in:
Daniel Jurek 2021-06-03 08:25:47 -07:00 committed by GitHub
parent 1b132190ee
commit cdda8104a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,10 +34,8 @@ function currentVersion() {
}
function currentPackage() {
// C docs are generated as a monolith, the correct path is:
// https://azuresdkdocs.blob.core.windows.net/$web/c/docs/{version}/index.html
// This sets the "docs" piece of the URL path
return "docs";
// Filled in by Doxygen template
return "$projectname";
}
function httpGetAsync(targetUrl, callback) {
@ -74,16 +72,12 @@ function populateOptions(optionSelector, otherSelectors) {
httpGetAsync(versionRequestUrl, function(responseText) {
if (responseText) {
let options = responseText.match(/[^\r\n]+/g);
populateVersionDropDown(optionSelector, options);
showSelectors(otherSelectors);
$(optionSelector).change(function() {
targetVersion = $(this).val();
url = WINDOW_CONTENTS.slice();
url[6] = targetVersion;
window.location.href = url.join("/");
window.location.href = getPackageUrl(SELECTED_LANGUAGE, currentPackage(), targetVersion);
});
}
});