mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
Prevent opening the status and filters panel at the same time, and fix a bug where status area got appended to rather than replaced
This commit is contained in:
@@ -164,6 +164,7 @@ function updateTable() {
|
|||||||
// Load server status
|
// Load server status
|
||||||
function loadStatus() {
|
function loadStatus() {
|
||||||
$.getJSON('/api/status', function(jsonData) {
|
$.getJSON('/api/status', function(jsonData) {
|
||||||
|
$("#status-container").empty();
|
||||||
$("#status-container").append(generateStatusCard("Server Information", [
|
$("#status-container").append(generateStatusCard("Server Information", [
|
||||||
`Software Version: ${jsonData["software-version"]}`,
|
`Software Version: ${jsonData["software-version"]}`,
|
||||||
`Server Owner Callsign: ${jsonData["server-owner-callsign"]}`,
|
`Server Owner Callsign: ${jsonData["server-owner-callsign"]}`,
|
||||||
@@ -340,9 +341,13 @@ function loadSettings() {
|
|||||||
// Set up UI element event listeners, after the document is ready
|
// Set up UI element event listeners, after the document is ready
|
||||||
function setUpEventListeners() {
|
function setUpEventListeners() {
|
||||||
$("#status-button").click(function() {
|
$("#status-button").click(function() {
|
||||||
// If we are going to display status, load the data for the status panel
|
// If we are going to display status, load the data for the status panel, and hide the filters panel
|
||||||
if (!$("#status-area").is(":visible")) {
|
if (!$("#status-area").is(":visible")) {
|
||||||
loadStatus();
|
loadStatus();
|
||||||
|
if ($("#filters-area").is(":visible")) {
|
||||||
|
$("#filters-area").hide();
|
||||||
|
$("#filters-button").button("toggle");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$("#status-area").toggle();
|
$("#status-area").toggle();
|
||||||
});
|
});
|
||||||
@@ -351,7 +356,12 @@ function setUpEventListeners() {
|
|||||||
$("#status-area").hide();
|
$("#status-area").hide();
|
||||||
});
|
});
|
||||||
$("#filters-button").click(function() {
|
$("#filters-button").click(function() {
|
||||||
$("#filters-area").toggle();
|
// If we are going to display filters, hide the filters panel
|
||||||
|
if (!$("#filters-area").is(":visible") && $("#status-area").is(":visible")) {
|
||||||
|
$("#status-area").hide();
|
||||||
|
$("#status-button").button("toggle");
|
||||||
|
}
|
||||||
|
$("#filters-area").toggle();
|
||||||
});
|
});
|
||||||
$("#close-filters-button").click(function() {
|
$("#close-filters-button").click(function() {
|
||||||
$("#filters-button").button("toggle");
|
$("#filters-button").button("toggle");
|
||||||
|
|||||||
Reference in New Issue
Block a user