Skip to content

Commit

Permalink
fix: ensure home link does not change selected version (microsoft#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunattam authored Sep 9, 2020
1 parent a695768 commit 71c120f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ window.addEventListener('DOMContentLoaded', async() => {
new Promise((res, rej) => onDOMEvent(signal, 'abort', () => rej(new Error('New operation scheduled in throttler! Aborting current one.')))),
]);

// For non-default versions, ensure home link does not change selected version
const homeLinkElement = document.querySelector('a.home-navigation')
homeLinkElement.href = projectVersion === defaultVersion ? "#" : `#version=${projectVersion.version()}`;

document.body.classList.remove('show-mobile-sidebar');

versionSelector.querySelector(`[value="${projectVersion.version()}"]`).selected = true;
Expand Down

0 comments on commit 71c120f

Please sign in to comment.