diff --git a/htdocs/public/css/main.css b/htdocs/public/css/main.css index 7c587cd..16fa67a 100755 --- a/htdocs/public/css/main.css +++ b/htdocs/public/css/main.css @@ -93,6 +93,10 @@ a { background-image: url(/images/checked.png); } +.dropdown-content-checkbox-hidden { + display: none !important; +} + /* Hide the link that should open and close the topnav on small screens */ .topnav .icon { display: none; diff --git a/htdocs/public/index.php b/htdocs/public/index.php index 414ace9..5abb463 100755 --- a/htdocs/public/index.php +++ b/htdocs/public/index.php @@ -58,6 +58,7 @@ options['isMobile'] = false; options['useImperialUnit'] = ; options['coverageDataUrl'] = 'data/coverage.php';; + options['defaultTimeLength'] = 60; // In minutes var md = new MobileDetect(window.navigator.userAgent); if (md.mobile() !== null) { @@ -173,12 +174,12 @@ diff --git a/htdocs/public/js/main.js b/htdocs/public/js/main.js index 7967c9a..37b9e0f 100755 --- a/htdocs/public/js/main.js +++ b/htdocs/public/js/main.js @@ -19,6 +19,11 @@ if (!inIframe()) { $("#tdTopnav").hide(); } +// Set correct time length option to active +jQuery(document).ready(function ($) { + $("#tdTopnavTimelengthDefault").addClass("dropdown-content-checkbox-active"); +}); + // Open station dialog if user clicked on station name jQuery(document).ready(function ($) { trackdirect.addListener("station-name-clicked", function (data) { @@ -86,9 +91,10 @@ jQuery(document).ready(function ($) { // Time travel is stopped when filtering is stopped $("#right-container-timetravel").hide(); - // Tail length is reset to 60 minutes when filtering is stopped - $("#tdTopnavTimelength>a").removeClass("active"); - $("#tdTopnavTimelength60").addClass("active"); + // Reset tail length to default when filtering is stopped + $("#tdTopnavTimelength>a").removeClass("dropdown-content-checkbox-active"); + $("#tdTopnavTimelengthDefault").addClass("dropdown-content-checkbox-active"); + $(".dropdown-content-checkbox-only-filtering").addClass("dropdown-content-checkbox-hidden"); } else { var counts = {}; for (var i = 0; i < packets.length; i++) { @@ -102,6 +108,7 @@ jQuery(document).ready(function ($) { "Filtering on " + Object.keys(counts).length + " station(s)" ); $("#right-container-filtered").show(); + $(".dropdown-content-checkbox-only-filtering").removeClass("dropdown-content-checkbox-hidden"); } }); });