summaryrefslogblamecommitdiffstats
path: root/js/settings.js
blob: 2e0e6ac54e3a5e1dac844a5af4454aa8648700f5 (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 });
});