Commit dab75f45 authored by Karl Hasselbring's avatar Karl Hasselbring
Browse files

Sprachlabel hinzugefügt

parent 1ba87df3
......@@ -62,7 +62,7 @@ function setActionListeners() {
/**
* Loads stored settings from local storage
*/
function setSettings () {
function setSettings() {
if ($('fieldset#foki.mobile').length) {
$('fieldset.mobile input#bilder').val('angepasst');
$('fieldset.mobile input#bilder').prop('checked', true);
......@@ -156,7 +156,7 @@ var isChrome = !!window.chrome && !!window.chrome.webstore;
var isBlink = (isChrome || isOpera) && !!window.CSS;
// Prüft, ob der URL-Parameter "usage" auf "once" gesetzt ist.
function loadSavedResults () {
function loadSavedResults() {
var results = new Results();
if (results.length > 0) {
var html = $('\
......
$(function () {
loadLocalStorage();
setActionListenersSearchbar();
updateLangLabelCode();
});
function setActionListenersSearchbar() {
......@@ -21,14 +22,15 @@ function loadKey() {
}
function saveLang() {
var key = $('#input-lang').val();
localStorage.setItem('lang', key);
var lang = $('#input-lang').val();
localStorage.setItem('lang', lang);
updateLangLabelCode(lang);
}
function loadLang() {
var key = localStorage.getItem('lang');
if (key != null) {
$('#input-lang').val(key);
var lang = localStorage.getItem('lang');
if (lang != null) {
$('#input-lang').val(lang);
}
}
......@@ -68,4 +70,11 @@ function setSettings() {
if (requestMethod !== null && (requestMethod === 'GET' || requestMethod === 'POST')) {
$('#searchForm').attr('method', requestMethod);
}
}
function updateLangLabelCode(langcode = null) {
if (!langcode) {
var langcode = localStorage.getItem('lang');
}
$('#lang-label-code').html(langcode);
}
\ No newline at end of file
......@@ -35,6 +35,8 @@
}
#search-lang,
#search-key {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
z-index: 1;
#input-lang,
......@@ -42,11 +44,16 @@
margin: 0;
padding: 0px;
border: none;
-webkit-box-shadow: none;
box-shadow: none;
height: 40px;
width: 0px;
outline-color: green;
-webkit-transition: width 0.5s, padding 0.5s, outline-color 0s, border-color 0s, -webkit-box-shadow 0s;
transition: width 0.5s, padding 0.5s, outline-color 0s, border-color 0s, -webkit-box-shadow 0s;
transition: width 0.5s, padding 0.5s, outline-color 0s, border-color 0s, box-shadow 0s;
transition: width 0.5s, padding 0.5s, outline-color 0s, border-color 0s, box-shadow 0s, -webkit-box-shadow 0s;
-webkit-transition-delay: 0.3s;
transition-delay: 0.3s;
&:focus {
width: 200px;
......@@ -69,11 +76,22 @@
height: 40px;
width: 40px;
margin: 0;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-transition: width 0s, visibility 0s;
transition: width 0s, visibility 0s;
-webkit-transition-delay: 0.3s;
transition-delay: 0.3s;
#lang-label-code {
margin-left: 5px;
}
}
}
.search-input {
......
......@@ -13,6 +13,7 @@
</select>
<label id="lang-label" for="input-lang" data-tooltip="{{ trans ('index.lang.tooltip') }}">
<i class="fa fa-globe" aria-hidden="true"></i>
<span id="lang-label-code"></span>
</label>
</div>
<div id="search-key">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment