proper selection, fixes

This commit is contained in:
SpikeHD 2022-04-22 22:17:26 -07:00
parent 632820e277
commit 0d97307e9a
3 changed files with 19 additions and 5 deletions

View File

@ -18,9 +18,11 @@
</div>
</div>
<div id="settingsPanel" style="display: none;">
<span id="fullSettingsTitle">Settings</span>
<div id="settingsClose">
<img src="icons/close.svg" onclick="closeSettings()" />
<div id="settingsTitleBar">
<span id="fullSettingsTitle">Settings</span>
<div id="settingsClose">
<img src="icons/close.svg" onclick="closeSettings()" />
</div>
</div>
<div id="settingsPanelInner">
<div class="settingTitle", id="scriptsTitle">

View File

@ -497,7 +497,7 @@ async function toggleServerLaunchSection() {
async function getLanguages() {
const languageFiles = (await filesystem.readDirectory(`${NL_CWD}/languages`)).filter(file => file.entry.endsWith('.json'))
const config = await getCfg()
// Load all languages as options
for (const file of languageFiles) {
@ -507,9 +507,15 @@ async function getLanguages() {
const option = document.createElement('option')
option.value = lang
option.innerHTML = fullLanguageName
// Set language selected to config language
if (lang === config.language) {
option.selected = true
}
document.querySelector('#languageSelect').appendChild(option)
}
}
async function handleLanguageChange(elm) {

View File

@ -102,9 +102,15 @@ body {
height: 30px;
}
#settingsTitleBar {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
#settingsClose {
display: inline-block;
margin-left: 70%;
transition: filter 0.1s ease-in-out;
}