From cdda8104a73665ee4d1b5caf94a0e4ab23883c6c Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 3 Jun 2021 08:25:47 -0700 Subject: [PATCH] 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 --- eng/docs/api/assets/header.html | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/eng/docs/api/assets/header.html b/eng/docs/api/assets/header.html index cab0c7725..510f916e3 100644 --- a/eng/docs/api/assets/header.html +++ b/eng/docs/api/assets/header.html @@ -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); }); } });