From 09437551e682bdd565ee8c987e8e97f6e8b50e6f Mon Sep 17 00:00:00 2001 From: phl0 Date: Wed, 22 Apr 2020 12:12:51 +0200 Subject: [PATCH] Only show details box if there is a QSO at all --- application/views/interface_assets/footer.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index d873a394..e5556557 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -906,7 +906,6 @@ $(document).ready(function(){ var lng = LatLng.lng; var locator = LatLng2Loc(lat,lng, 10); var loc_4char = locator.substring(0, 4); - var count = 0; console.log(loc_4char); console.log(map.getZoom()); @@ -922,7 +921,7 @@ $(document).ready(function(){ } $.getJSON( "" + search_tags, function( data ) { - count = Object.keys(data).length; + var count = Object.keys(data).length; console.log("Count: " + count); var items = []; $.each( data, function( i, item ) { @@ -940,13 +939,16 @@ $(document).ready(function(){ } else { $('#gt1_qso').text(""); } + $("#grid_results tbody").empty(); - $("#grid_results tbody").append(items.join( "" )); + if (count > 0) { + $("#grid_results tbody").append(items.join( "" )); + + $('#square_number').text(loc_4char); + $('#exampleModal').modal('show'); + } }); - - $('#square_number').text(loc_4char); - $('#exampleModal').modal('show'); } };