Skip to content

Commit 9083eed

Browse files
committed
Remove jQuery and use vanilla JS instead
The language switcher is now simpler.
1 parent aca560a commit 9083eed

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

_includes/footer.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,12 @@
4747
}
4848
}
4949
};
50-
</script>
5150

52-
<script src="https://code.jquery.com/jquery-3.0.0.min.js" integrity="sha256-JmvOoLtYsmqlsWxa7mDSLMwa6dZ9rrIdtrrVYRnDRH0=" crossorigin="anonymous"></script>
53-
<script src="/assets/js/i18n.js"></script>
51+
document.getElementById('languages').onchange = function(ev) {
52+
if (ev.currentTarget && ev.currentTarget.value) {
53+
location.href = ev.currentTarget.value;
54+
}
55+
};
56+
</script>
5457
</body>
5558
</html>

_includes/languages.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<select class="languages">
1+
<select id="languages" class="languages">
22
<option value="">Change Language</option>
33
{% for lang in site.languages %}
44
<option value="{{ lang.path }}">{{ lang.label }}</option>

0 commit comments

Comments
 (0)