diff options
author | Anton Luka Šijanec <sijanecantonluka@gmail.com> | 2020-03-10 16:25:29 +0100 |
---|---|---|
committer | Anton Luka Šijanec <sijanecantonluka@gmail.com> | 2020-03-10 16:25:29 +0100 |
commit | 190f3aaf31fdfba96b0f5ff91dcbe4aba58dac71 (patch) | |
tree | 6cb41125b119687b725c05ddc318837fa72930a6 /js/settings.js | |
parent | 1.0.11.7 (diff) | |
download | beziapp-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 'js/settings.js')
-rw-r--r-- | js/settings.js | 17 |
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 }); +}); |