Skip to content

Commit

Permalink
ENH try to stay on current page if switching versions
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewandante committed Oct 5, 2023
1 parent d9e3aa8 commit 6d29115
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion conf/themes/silverstripe/doctum.js.twig
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ $(function() {
{% if project.versions|length > 1 %}
// Enable the version switcher
$('#version-switcher').on('change', function() {
window.location = $(this).val()
var currentLocation = window.location.pathname.substring(2);
window.location = '/' + $(this).data('version') + currentLocation;
});
var versionSwitcher = document.getElementById('version-switcher');
if (versionSwitcher) {
Expand Down

0 comments on commit 6d29115

Please sign in to comment.