From bcc7b8c692a92f965f9492aa2d72d2700d4f54e4 Mon Sep 17 00:00:00 2001 From: Ihor Aleksandrychiev Date: Wed, 8 Apr 2026 10:16:53 +0300 Subject: [PATCH] Adjusted selectVersion to support localtion version replace Ticket: ENT-13842 Signed-off-by: Ihor Aleksandrychiev --- themes/docs/static/js/main.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/docs/static/js/main.js b/themes/docs/static/js/main.js index 6c2bb38..e85058c 100644 --- a/themes/docs/static/js/main.js +++ b/themes/docs/static/js/main.js @@ -360,11 +360,11 @@ document.querySelectorAll('.dropdown-select').forEach(function (item) { item.querySelector('span div').textContent = selected_version.textContent; }); -function selectVersion(value) { - if (value.indexOf('archive') == -1 && window.currentVersionLink) { - window.location = window.location.href.replace(window.currentVersionLink, value); +function selectVersion(version, currentVersion = null, replaceVersionInLcocation = false) { + if (replaceVersionInLcocation && currentVersion) { + window.location = window.location.href.replace(currentVersion, version); } else { - window.location = value; + window.location = version; } }; window.selectVersion = selectVersion;