Skip to content

Commit

Permalink
At init, selects the version shown as active (#869)
Browse files Browse the repository at this point in the history
* At init, selects the version shown as active (fix #868)
  • Loading branch information
Yopai committed Apr 27, 2020
1 parent fb05829 commit d29a622
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions template/main.js
Expand Up @@ -537,11 +537,13 @@ require([
// HTML-Template specific jQuery-Functions
//
// Change Main Version
$('#versions li.version a').on('click', function(e) {
e.preventDefault();

var selectedVersion = $(this).html();
$('#version strong').html(selectedVersion);
function setMainVersion(selectedVersion) {
if (typeof(selectedVersion) === 'undefined') {
selectedVersion = $('#version strong').html();
}
else {
$('#version strong').html(selectedVersion);
}

// hide all
$('article').addClass('hide');
Expand Down Expand Up @@ -577,6 +579,13 @@ require([

initDynamic();
return;
}
setMainVersion();

$('#versions li.version a').on('click', function(e) {
e.preventDefault();

setMainVersion($(this).html());
});

// compare all article with their predecessor
Expand Down

0 comments on commit d29a622

Please sign in to comment.