Skip to content
Snippets Groups Projects
Commit 8020f5c6 authored by Karl Hasselbring's avatar Karl Hasselbring
Browse files

Auch die Sprache wird jetzt gespeichert

parent 5219310c
No related branches found
No related tags found
2 merge requests!1262WIP: Resolve "Spendenseite Texte anpassen",!1248Resolve "Eingestellte Sprache für Suche verwenden"
...@@ -4,7 +4,8 @@ $(function () { ...@@ -4,7 +4,8 @@ $(function () {
}); });
function setActionListenersSearchbar() { function setActionListenersSearchbar() {
$('#input-key').keydown(saveKey); $('#input-key').change(saveKey);
$('#input-lang').change(saveLang);
} }
function saveKey() { function saveKey() {
...@@ -14,7 +15,21 @@ function saveKey() { ...@@ -14,7 +15,21 @@ function saveKey() {
function loadKey() { function loadKey() {
var key = localStorage.getItem('key'); var key = localStorage.getItem('key');
$('#input-key').val(key); if (key != null) {
$('#input-key').val(key);
}
}
function saveLang() {
var key = $('#input-lang').val();
localStorage.setItem('lang', key);
}
function loadLang() {
var key = localStorage.getItem('lang');
if (key != null) {
$('#input-lang').val(key);
}
} }
/** /**
...@@ -24,6 +39,7 @@ function loadLocalStorage() { ...@@ -24,6 +39,7 @@ function loadLocalStorage() {
if (localStorage) { if (localStorage) {
setSettings(); setSettings();
loadKey(); loadKey();
loadLang();
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment