search UI: hide unused query parameters

Only send query parameters relevant for the current query
type (simple/structured), hide the other input fields.

This is quite a bit of CSS state changing, so move the intial
setup of the input field states into Javascript.
This commit is contained in:
Sarah Hoffmann
2020-05-11 00:15:30 +02:00
parent 233e5f7c0e
commit 9e2841ad44
2 changed files with 25 additions and 25 deletions

View File

@@ -31,14 +31,24 @@ jQuery(document).ready(function(){
if (query_val == "simple") {
$("div.form-group-structured").hide();
$("div.form-group-simple").show();
$("div.form-group-structured .form-control").prop('disabled', true);
$("div.form-group-simple .form-control").prop('disabled', false);
$('.form-group-structured').find('input:text').val('');
}
else if (query_val == "structured") {
$("div.form-group-simple").hide();
$("div.form-group-structured").show();
$("div.form-group-structured .form-control").prop('disabled', false);
$("div.form-group-simple .form-control").prop('disabled', true);
$('.form-group-simple').find('input:text').val('');
}
});
if (nominatim_structured_query) {
$('input#structured').prop('checked', true).trigger('click');
} else {
$('input#simple').prop('checked', true).trigger('click');
}
});
map = new L.map('map', {