Skip to content

Commit

Permalink
Merge pull request osmlab#66 from hashtagdeamon/gh-pages
Browse files Browse the repository at this point in the history
Fixing issue osmlab#63 (prevent empty note)
  • Loading branch information
iandees authored Jul 20, 2018
2 parents 070da34 + 0797466 commit 686b166
Show file tree
Hide file tree
Showing 7 changed files with 224 additions and 211 deletions.
7 changes: 5 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h2 class="app-title" data-i18n="app.title"></h2>
<a href='#location' data-i18n="step1.title"></a>
</div>
<div class='col4 center pad1 step-2'>
<a href='#details' data-i18n="step2.title"></a>
<strong onclick="check_coordinates()" data-i18n="step2.title"></strong>
</div>
<div class='col4 center pad1 step-3'>
<strong data-i18n="step3.title"></strong>
Expand All @@ -55,6 +55,9 @@ <h2 class="app-title" data-i18n="app.title"></h2>
<div class='center pad2'>
<p id="couldnt-find" style='display: none;' data-i18n="[html]step1.fail"></p>
</div>
<div class='center pad2'>
<p id="invalid-location" style='display: none;' data-i18n="[html]step1.invalid-location"></p>
</div>
<div class='col12'>
<div class='col12' id='findme-map'></div>
<p id="success" class="center" style='display: none; margin-bottom: 500px;'></p>
Expand Down Expand Up @@ -95,7 +98,7 @@ <h4><button class='col12' id='collect-data-done' data-i18n="step2.done"></button
</p>
</div>

<footer><p class="center" data-i18n="[html]app.footer">Source code available on <a href="https://github.com/osmlab/onosm.org">Github</p></footer>
<footer><p class="center" data-i18n="[html]app.footer">Source code available on <a href="https://github.com/osmlab/onosm.org">Github</a></p></footer>
</div>
<script src='js/site.js'></script>
</body>
Expand Down
11 changes: 11 additions & 0 deletions js/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ $("#use_my_location").click(function (e) {
$("#find").submit(function(e) {
e.preventDefault();
$("#couldnt-find").hide();
$("#invalid-location").hide();
$("#success").hide();
var address_to_find = $("#address").val();
if (address_to_find.length === 0) return;
Expand Down Expand Up @@ -151,3 +152,13 @@ function clearFields() {
$("#address").val('');
$("#linkcoords").empty();
}

function check_coordinates() {
var latlon = findme_marker.getLatLng();

if ((latlon.lat != 0) || (latlon.lng != 0)) {
location.hash = '#details';
} else {
$("#invalid-location").show();
}
}
Loading

0 comments on commit 686b166

Please sign in to comment.