summaryrefslogtreecommitdiffstats
path: root/js/settings.js
diff options
context:
space:
mode:
authorAnton Luka Šijanec <sijanecantonluka@gmail.com>2020-03-10 16:25:29 +0100
committerAnton Luka Šijanec <sijanecantonluka@gmail.com>2020-03-10 16:25:29 +0100
commit190f3aaf31fdfba96b0f5ff91dcbe4aba58dac71 (patch)
tree6cb41125b119687b725c05ddc318837fa72930a6 /js/settings.js
parent1.0.11.7 (diff)
downloadbeziapp-190f3aaf31fdfba96b0f5ff91dcbe4aba58dac71.tar
beziapp-190f3aaf31fdfba96b0f5ff91dcbe4aba58dac71.tar.gz
beziapp-190f3aaf31fdfba96b0f5ff91dcbe4aba58dac71.tar.bz2
beziapp-190f3aaf31fdfba96b0f5ff91dcbe4aba58dac71.tar.lz
beziapp-190f3aaf31fdfba96b0f5ff91dcbe4aba58dac71.tar.xz
beziapp-190f3aaf31fdfba96b0f5ff91dcbe4aba58dac71.tar.zst
beziapp-190f3aaf31fdfba96b0f5ff91dcbe4aba58dac71.zip
Diffstat (limited to '')
-rw-r--r--js/settings.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/js/settings.js b/js/settings.js
new file mode 100644
index 0000000..41c9df1
--- /dev/null
+++ b/js/settings.js
@@ -0,0 +1,17 @@
+// settings.js -- TODO
+
+async function setLanguage(langCode) {
+ localforage.setItem("chosenLang", langCode).then( () => {
+ UIAlert(D("languageSet"), "setLanguage(): languageSet");
+ });
+}
+
+document.addEventListener("DOMContentLoaded", async () => {
+ $(document).on("click",".settings-language-selector", function () {
+ let languageToSet = $(this).attr('data-language');
+ setLanguage(languageToSet);
+ });
+ // Setup side menu
+ const menus = document.querySelectorAll(".side-menu");
+ M.Sidenav.init(menus, { edge: "right", draggable: true });
+});