Pressing the reset button on the QSO page resets all the correct fields
这个提交包含在:
父节点
59ccc02fa1
当前提交
914a815aef
共有 2 个文件被更改,包括 11 次插入 和 8 次删除
|
|
@ -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 ) {
|
function reset_fields() {
|
||||||
console.log("trigger");
|
|
||||||
$('#callsign_info').text("");
|
$('#callsign_info').text("");
|
||||||
$('#locator_info').text("");
|
$('#locator_info').text("");
|
||||||
$('#country').val("");
|
$('#country').val("");
|
||||||
|
|
@ -217,6 +212,15 @@ $(document).ready(function(){
|
||||||
mymap.setView([51.505, -0.09], 13);
|
mymap.setView([51.505, -0.09], 13);
|
||||||
mymap.removeLayer(markers);
|
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
|
// Set Map to Lat/Long
|
||||||
markers.clearLayers();
|
markers.clearLayers();
|
||||||
if (typeof result.latlng !== "undefined") {
|
if (typeof result.latlng !== "undefined") {
|
||||||
console.log("defined!");
|
|
||||||
var marker = L.marker([result.latlng[0], result.latlng[1]]);
|
var marker = L.marker([result.latlng[0], result.latlng[1]]);
|
||||||
mymap.setView([result.latlng[0], result.latlng[1]], 8);
|
mymap.setView([result.latlng[0], result.latlng[1]], 8);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -270,7 +270,7 @@
|
||||||
<input size="20" id="country" type="hidden" name="country" value="" />
|
<input size="20" id="country" type="hidden" name="country" value="" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="reset" class="btn btn-light">Reset</button>
|
<button type="reset" class="btn btn-light" onclick="reset_fields()">Reset</button>
|
||||||
<button type="submit" class="btn btn-primary"><i class="fas fa-save"></i> Save QSO</button>
|
<button type="submit" class="btn btn-primary"><i class="fas fa-save"></i> Save QSO</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用