Skip to content

Commit 7efb6bf

Browse files
committed
Use _CURRENT_RELEASE in _create_version_select()
1 parent d1b7ad8 commit 7efb6bf

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;
@@ -124,7 +123,7 @@ const _on_language_switch = (event) => {
124123
};
125124

126125
const _initialise_switchers = () => {
127-
const version_select = _create_version_select(_CURRENT_VERSION);
126+
const version_select = _create_version_select();
128127
document
129128
.querySelectorAll('.version_switcher_placeholder')
130129
.forEach((placeholder) => {

0 commit comments

Comments
 (0)