From 914a815aeff0859129f293d4c7a66210e0b90166 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Mon, 24 Jun 2019 16:13:51 +0100 Subject: [PATCH] Pressing the reset button on the QSO page resets all the correct fields --- application/views/interface_assets/footer.php | 17 ++++++++++------- application/views/qso/index.php | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index 3ad8dc40..f0e02446 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -193,13 +193,8 @@ $(document).ready(function(){ } }); - jQuery(function($) { - var input = $('#callsign'); - input.on('keydown', function() { - var key = event.keyCode || event.charCode; - if( key == 8 || key == 46 ) { - console.log("trigger"); + function reset_fields() { $('#callsign_info').text(""); $('#locator_info').text(""); $('#country').val(""); @@ -216,6 +211,15 @@ $(document).ready(function(){ mymap.setView([51.505, -0.09], 13); mymap.removeLayer(markers); + } + + jQuery(function($) { + var input = $('#callsign'); + input.on('keydown', function() { + var key = event.keyCode || event.charCode; + + if( key == 8 || key == 46 ) { + reset_fields(); } }); }); @@ -241,7 +245,6 @@ $(document).ready(function(){ // Set Map to Lat/Long markers.clearLayers(); if (typeof result.latlng !== "undefined") { - console.log("defined!"); var marker = L.marker([result.latlng[0], result.latlng[1]]); mymap.setView([result.latlng[0], result.latlng[1]], 8); } else { diff --git a/application/views/qso/index.php b/application/views/qso/index.php index 14513446..9eccea99 100755 --- a/application/views/qso/index.php +++ b/application/views/qso/index.php @@ -270,7 +270,7 @@ - +