From f995c6d415b994c439280f883ebf387b45d876e0 Mon Sep 17 00:00:00 2001 From: Andrew Koenig Date: Mon, 23 Dec 2024 11:02:12 -0600 Subject: [PATCH 1/2] Change default map/table behavior to open --- auto_rx/autorx/templates/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auto_rx/autorx/templates/index.html b/auto_rx/autorx/templates/index.html index 198c708..36de7c0 100644 --- a/auto_rx/autorx/templates/index.html +++ b/auto_rx/autorx/templates/index.html @@ -311,7 +311,7 @@ }); // Check if user has preffered map visiblity. - if (getCookie('map') == 'true') { + if (getCookie('map') == 'true' || getCookie('map') == null) { document.getElementById("mapid_details").setAttribute("open", true) ; } else { document.getElementById("mapid_details").removeAttribute("open") ; @@ -319,7 +319,7 @@ } // Check if user has preffered table visiblity. - if (getCookie('table') == 'true') { + if (getCookie('table') == 'true' || getCookie('table') == null) { document.getElementById("tableid").setAttribute("open", true) ; } else { document.getElementById("tableid").removeAttribute("open") ; From 045ba43d52ee65de8f0f347af0c642e83c795845 Mon Sep 17 00:00:00 2001 From: Andrew Koenig Date: Mon, 23 Dec 2024 11:10:53 -0600 Subject: [PATCH 2/2] Invert logic per suggestion from @argilo --- auto_rx/autorx/templates/index.html | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/auto_rx/autorx/templates/index.html b/auto_rx/autorx/templates/index.html index 36de7c0..e0019da 100644 --- a/auto_rx/autorx/templates/index.html +++ b/auto_rx/autorx/templates/index.html @@ -311,18 +311,18 @@ }); // Check if user has preffered map visiblity. - if (getCookie('map') == 'true' || getCookie('map') == null) { - document.getElementById("mapid_details").setAttribute("open", true) ; - } else { + if (getCookie('map') == 'false') { document.getElementById("mapid_details").removeAttribute("open") ; document.getElementById("mapid").style.display = "none"; + } else { + document.getElementById("mapid_details").setAttribute("open", true) ; } // Check if user has preffered table visiblity. - if (getCookie('table') == 'true' || getCookie('table') == null) { - document.getElementById("tableid").setAttribute("open", true) ; - } else { + if (getCookie('table') == 'false') { document.getElementById("tableid").removeAttribute("open") ; + } else { + document.getElementById("tableid").setAttribute("open", true) ; } // Check if user has preffered follow latest sonde selection.