Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
StrikerRUS authored Oct 10, 2024
1 parent 22204dd commit 17ede77
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions docs/_static/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ $(function() {
$('.py.property').each(function() { this.style.setProperty('display', 'inline', 'important'); });
}

/* Fix needed */
var current_version_elems = $('.rst-current-version');
/* Point to the same version of R API as the current docs version */
var current_version_elems = $('nav.wy-nav-side > * div.version');
if(current_version_elems.length !== 0) {
var current_version = $(current_version_elems[0]).contents().filter(function() {
return this.nodeType == 3;
}).text().trim().split(' ').pop();
var current_version = $(current_version_elems[0]).text().trim();
if(current_version !== 'latest') {
$('a.reference.external[href$="/latest/R/reference/"]').each(function() {
$(this).attr('href', function (_, val) { return val.replace('/latest/', '/' + current_version + '/'); });
Expand Down

0 comments on commit 17ede77

Please sign in to comment.