Hide winkey buttons

pull/2359/head
Peter Goodhall 2023-08-01 16:37:57 +01:00
rodzic fc687978f8
commit b79229f326
2 zmienionych plików z 12 dodań i 4 usunięć

Wyświetl plik

@ -533,7 +533,7 @@
</h4>
</div>
<div class="card-body">
<div id="winkey_buttons" class="card-body">
<div id="modals-here"></div>
<button id="morsekey_func1" onclick="morsekey_func1()" class="btn btn-warning">F1</button>
<button id="morsekey_func2" onclick="morsekey_func2()" class="btn btn-warning">F2</button>

Wyświetl plik

@ -1,5 +1,11 @@
// Lets see if CW is selected
let isWinkeyConnected = false;
// if isWinkeyConnected is false
if (!isWinkeyConnected) {
$('#winkey_buttons').hide();
}
// Lets see if CW is selected
const ModeSelected = document.getElementById('mode');
if (location.protocol == 'http:') {
@ -70,7 +76,6 @@ let statusBar = document.getElementById("statusBar");
//Couple the elements to the Events
connectButton.addEventListener("click", clickConnect)
sendButton.addEventListener("click", clickSend)
helpButton.addEventListener("click", clickHelp)
statusButton.addEventListener("click", clickStatus)
//When the connectButton is pressed
@ -78,10 +83,11 @@ async function clickConnect() {
if (port) {
//if already connected, disconnect
disconnect();
$('#winkey_buttons').hide();
} else {
//otherwise connect
await connect();
$('#winkey_buttons').show();
}
}
@ -107,6 +113,8 @@ async function connect() {
//Try to connect to the Serial port
try {
isWinkeyConnected = true;
$('#winkey_buttons').show();
port = await navigator.serial.requestPort(/*{ filters: [filter] }*/);
// Continue connecting to |port|.