Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions iFakeLocation/Resources/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ <h4 class="my-0 mr-md-auto font-weight-normal">iFakeLocation</h4>

<p><small>Click and drag to move the map. Use the mouse wheel or +/- buttons to zoom. Double-click anywhere (or drag the existing marker) to manually select a location.</small></p>

<form>
<form id="locationSearch">
<div class="mb-3">
<div class="row align-items-center">
<div class="col-md-auto">
Expand Down Expand Up @@ -321,6 +321,16 @@ <h5 class="modal-title">About iFakeLocation</h5>

// Handle search button
$('#search').click(function() {
searchLocation();
});

// Handle Enter Key in search field
document.getElementById('locationSearch').addEventListener('submit', function(e) {
e.preventDefault(); //to prevent form submission
searchLocation();
});

function searchLocation(){
if (!$('#query').val())
return;
$('#search').attr('disabled', true);
Expand All @@ -336,7 +346,7 @@ <h5 class="modal-title">About iFakeLocation</h5>
$('#set-location').removeAttr('disabled');
}
});
});
}

// Disable double-click zooming
map.doubleClickZoom.disable();
Expand All @@ -357,4 +367,4 @@ <h5 class="modal-title">About iFakeLocation</h5>
});
</script>
</body>
</html>
</html>