summaryrefslogblamecommitdiffstats
path: root/js/settings.js
blob: 41c9df15ec48e3dc426ffecba67b1783a739d058 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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 });
});