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








                                                                        
                                                                      
                                                                  

                                           
 



                                                                  
// 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", () => {
		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 });
});