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:
parent
1b132190ee
commit
cdda8104a7
@ -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);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user