summaryrefslogblamecommitdiffstats
path: root/dist/js/settings.js
blob: fda9ea52240bb7c29f4dd202391361a105f828f3 (plain) (tree)
1
2
3
4
5
6
7
8
9
10


                                       



                                                                 


                                                           



                                                          
 


                                                              
   
// settings.js -- TODO

async function setLanguage(langCode)  {
    localforage.setItem("chosenLang", langCode).then((value) => {
        console.log("Language set: " + value);
        UIAlert(D("languageSet"), "setLanguage(): languageSet");
    });
}

document.addEventListener("DOMContentLoaded", async () => {
    $(".settings-language-selector").click(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 });
});