Skip to content

Commit df622b0

Browse files
committed
Use _CURRENT_RELEASE in _create_version_select()
1 parent ee82059 commit df622b0

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

templates/switchers.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@ const _CURRENT_PREFIX = (() => {
1717
const all_versions = $VERSIONS;
1818
const all_languages = $LANGUAGES;
1919

20-
const _create_version_select = (release) => {
21-
const major_minor = release.split('.').slice(0, 2).join('.');
20+
const _create_version_select = () => {
2221
const select = document.createElement('select');
2322
select.className = 'version_select';
2423

2524
for (const [version, title] of Object.entries(all_versions)) {
2625
const option = document.createElement('option');
2726
option.value = version;
28-
if (version === major_minor) {
29-
option.text = release;
27+
if (version === _CURRENT_VERSION) {
28+
option.text = _CURRENT_RELEASE;
3029
option.selected = true;
3130
} else {
3231
option.text = title;
@@ -119,7 +118,7 @@ const _on_language_switch = (event) => {
119118
};
120119

121120
const _initialise_switchers = () => {
122-
const version_select = _create_version_select(_CURRENT_VERSION);
121+
const version_select = _create_version_select();
123122
document
124123
.querySelectorAll('.version_switcher_placeholder')
125124
.forEach((placeholder) => {

0 commit comments

Comments
 (0)