Skip to content

Commit

Permalink
Merge pull request #20 from IgniteUI/mkirova/versioning-additional-fix
Browse files Browse the repository at this point in the history
Additional fixes around versioning.
  • Loading branch information
zdrawku authored Nov 10, 2023
2 parents 2efafea + 801d2a8 commit 5e2fe4d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/assets/js/src/versioning/tag-versions.req.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(function () {
const versionsJson = $('body').data('api-versions-json');
const defaultUrl = $('body').data('default-url');
const defaultUrl = $('body').attr('default-url');
$.ajax({
url: versionsJson,
type: "get",
Expand All @@ -14,18 +14,19 @@

folders = folders.reverse();
folders.forEach(function (f) {
const versionUrl = defaultUrl.replace("typescript/latest'", f + "/typescript")
const versionUrl = defaultUrl.replace("typescript/latest", f + "/typescript");
select.append($('<option>', {
value: versionUrl,
text: f
}));
});

const version = folders.filter(function(v){ return window.location.href.indexOf(v) >= 0;})[0];
const version = folders.filter(function(v){ return window.location.href.indexOf(v) >= 0;})[0] || folders[0];
const currentVersionUrl = defaultUrl.replace("typescript/latest", version + "/typescript");
if (version) {
select.val(versionUrl);
select.val(currentVersionUrl);
} else {
select.val(versionUrl);
select.val(currentVersionUrl);
}
});

Expand Down

0 comments on commit 5e2fe4d

Please sign in to comment.