Skip to content

Commit b62ea7a

Browse files
committed
Use the event argument of select element callback functions
1 parent a593646 commit b62ea7a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

templates/switchers.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ const _navigate_to_first_existing = (urls) => {
7777
});
7878
};
7979

80-
const _on_version_switch = () => {
81-
const selected_version = this.options[this.selectedIndex].value + '/';
80+
const _on_version_switch = (event) => {
81+
const selected_version = event.target.value + '/';
8282
const url = window.location.href;
8383
const new_url = url.replace(
8484
_CURRENT_PREFIX,
@@ -95,8 +95,8 @@ const _on_version_switch = () => {
9595
}
9696
};
9797

98-
const _on_language_switch = () => {
99-
let selected_language = this.options[this.selectedIndex].value + '/';
98+
const _on_language_switch = (event) => {
99+
let selected_language = event.target.value + '/';
100100
const url = window.location.href;
101101
if (selected_language === 'en/')
102102
// Special 'default' case for English.

0 commit comments

Comments
 (0)