Skip to content

Commit

Permalink
Merge pull request #138 from mineralsfree/ENT-10384
Browse files Browse the repository at this point in the history
ENT-10384: Version dropdown navigates to the permalink for latest version
  • Loading branch information
olehermanse authored Nov 29, 2023
2 parents 0a989da + 1d738a8 commit aa205b0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,8 @@ document.querySelectorAll('.dropdown-select span').forEach(item => item.onclick
const versionsDropdown = document.querySelector('.dropdown-select.versions');
if (versionsDropdown) {
versionsDropdown.querySelectorAll('.dropdown-select_options > div').forEach(item => item.addEventListener('click', e => {
const {latest, version, module} = e.target.dataset
let url = `/modules/${module}/`
if (latest !== 'true') {
url += `${version}/`;
}
window.location.href = url;
const {version, module} = e.target.dataset
window.location.href = `/modules/${module}/${version}/`;
}))
}

Expand Down

0 comments on commit aa205b0

Please sign in to comment.