Move language selector under setting drop-down saving space

This commit is contained in:
LordGrey 2020-05-29 14:28:15 +02:00
parent 6c7b1813a7
commit b49ff0e5e2
3 changed files with 32 additions and 10 deletions

View File

@ -169,7 +169,6 @@ table label{margin:0}
}
.btn-lang-select {
color: #337ab7;
background-color: transparent;
border-style: none;
}

View File

@ -172,10 +172,21 @@
<i class="fa fa-wrench fa-fw"></i> <i class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu dropdown-alerts">
<!-- /.language selector -->
<li id="btn_setlang">
<a>
<div>
<i class="fa fa-globe"></i>
<select id="language-select" class="selectpicker" data-width="fit" data-style="btn-lang-select" > </select>
</div>
</a>
</li>
<li class="divider"></li>
<li id="btn_setaccess">
<a>
<div>
<i class="fa fa-key fa-fw"></i>
<i class="fa fa-wrench fa-fw"></i>
<span data-i18n="InfoDialog_access_title"></span>
</div>
</a>
@ -191,10 +202,6 @@
</li>
</ul>
</li>
<!-- /.language selector -->
<li>
<select id="language-select" class="selectpicker" data-width="fit" data-style="btn-lang-select" > </select>
</li>
<!-- /.lock-ui -->
<li class="dropdown" id="btn_lock_ui" style="display:none">

View File

@ -57,17 +57,33 @@ $(document).ready(function () {
}); // end cmd-serverinfo
// Update language
$('.selectpicker').on('changed.bs.select',function (e, clickedIndex, isSelected, previousValue){
var newLang = availLang[clickedIndex];
$("#language-select").on('changed.bs.select',function (e, clickedIndex, isSelected, previousValue){
var newLang = availLang[clickedIndex-1];
if (newLang !== storedLang)
{
setStorage("langcode", newLang);
reload();
reload();
}
});
$("#language-select").selectpicker(
{
container: 'body', title: availLangText[availLang.indexOf(getStorage("langcode"))]
});
$(".bootstrap-select").click(function () {
$(this).addClass("open");
});
$(document).click(function(){
$(".bootstrap-select").removeClass("open");
});
$(".bootstrap-select").click(function(e){
e.stopPropagation();
});
$(window.hyperion).on("cmd-sessions-update", function (event) {
window.serverInfo.sessions = event.response.data;
updateSessions();