Prettified Code!

This commit is contained in:
Mashintime 2023-05-15 21:13:50 +00:00 committed by GitHub Action
parent c1079085cd
commit 0c9e84ddf2
2 changed files with 16 additions and 6 deletions

View file

@ -1646,12 +1646,20 @@ window.addEventListener("DOMContentLoaded", () => {
});
});
function resetSortIcon(){
function resetSortIcon() {
document.getElementById("hslSort").remove();
let headers = document.querySelectorAll("#tblHeardStationList > thead > tr > th");
if (hslLastSortDir=="desc") text = "<i id=\"hslSort\" class=\"bi bi-sort-up\"></i>" + headers[hslLastSort].innerText;
else text = "<i id=\"hslSort\" class=\"bi bi-sort-down\"></i>" + headers[hslLastSort].innerText;
headers[hslLastSort].innerHTML=text;
let headers = document.querySelectorAll(
"#tblHeardStationList > thead > tr > th"
);
if (hslLastSortDir == "desc")
text =
'<i id="hslSort" class="bi bi-sort-up"></i>' +
headers[hslLastSort].innerText;
else
text =
'<i id="hslSort" class="bi bi-sort-down"></i>' +
headers[hslLastSort].innerText;
headers[hslLastSort].innerHTML = text;
}
function connectedStation(data) {

View file

@ -1152,7 +1152,9 @@
<table class="table table-sm" id="tblHeardStationList">
<thead>
<tr>
<th scope="col" id="thTime"><i id="hslSort" class="bi bi-sort-up"></i>Time</th>
<th scope="col" id="thTime">
<i id="hslSort" class="bi bi-sort-up"></i>Time
</th>
<th scope="col" id="thFreq">Frequency</th>
<th>&nbsp;</th>
<th scope="col" id="thDxcall">DXCall</th>