Skip to content

Commit

Permalink
Always create new select nodes (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
AA-Turner authored Oct 29, 2024
1 parent 58c9634 commit c1fc85c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions templates/switchers.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,21 +169,19 @@ const _initialise_switchers = () => {
const versions = _ALL_VERSIONS;
const languages = _ALL_LANGUAGES;

const version_select = _create_version_select(versions);
document
.querySelectorAll('.version_switcher_placeholder')
.forEach((placeholder) => {
const s = version_select.cloneNode(true);
const s = _create_version_select(versions);
s.addEventListener('change', _on_version_switch);
placeholder.append(s);
placeholder.classList.remove('version_switcher_placeholder');
});

const language_select = _create_language_select(languages);
document
.querySelectorAll('.language_switcher_placeholder')
.forEach((placeholder) => {
const s = language_select.cloneNode(true);
const s = _create_language_select(languages);
s.addEventListener('change', _on_language_switch);
placeholder.append(s);
placeholder.classList.remove('language_switcher_placeholder');
Expand Down

0 comments on commit c1fc85c

Please sign in to comment.