only show server launch button when panel is enabled

This commit is contained in:
SpikeHD 2022-04-22 20:06:18 -07:00
parent b89861fc38
commit c56c83b9c0
2 changed files with 4 additions and 1 deletions

View File

@ -108,7 +108,7 @@
<button class="smolBtn" onclick="setGenshinImpactFolder()">Set "Genshin Impact Game" folder</button> <button class="smolBtn" onclick="setGenshinImpactFolder()">Set "Genshin Impact Game" folder</button>
<span id="genshinPath" style="margin-top: 4px;"></span> <span id="genshinPath" style="margin-top: 4px;"></span>
</div> </div>
<div> <div style="display: none;">
<button class="smolBtn" onclick="setGrassCutterFolder()">Set "GrassCutter" .jar file</button> <button class="smolBtn" onclick="setGrassCutterFolder()">Set "GrassCutter" .jar file</button>
<span id="serverPath" style="margin-top: 4px;"></span> <span id="serverPath" style="margin-top: 4px;"></span>
</div> </div>

View File

@ -468,11 +468,14 @@ async function checkForUpdatesAndShow() {
async function displayServerLaunchSection() { async function displayServerLaunchSection() {
const serverPanel = document.querySelector('#thirdPanel') const serverPanel = document.querySelector('#thirdPanel')
const bottomBtnSection = document.querySelector('#serverPath').parentElement
if (serverPanel.style.display === 'none') { if (serverPanel.style.display === 'none') {
serverPanel.style.removeProperty('display') serverPanel.style.removeProperty('display')
bottomBtnSection.style.removeProperty('display')
} else { } else {
serverPanel.style.display = 'none' serverPanel.style.display = 'none'
bottomBtnSection.style.display = 'none'
} }
} }