From 9db3dd69e12bb27b078cc821b1d0f2aa942816fe Mon Sep 17 00:00:00 2001 From: marc tobias Date: Sat, 20 Jun 2020 22:53:06 +0200 Subject: [PATCH] forward search: use tabs to switch between simple and structured --- dist/assets/css/search.css | 6 +-- dist/assets/js/nominatim-ui.js | 14 ------ dist/search.html | 84 +++++++++++++++++++--------------- dist/searchpage.hbs | 82 ++++++++++++++++++--------------- src/assets/css/search.css | 6 +-- src/assets/js/searchpage.js | 14 ------ src/templates/searchpage.hbs | 82 ++++++++++++++++++--------------- 7 files changed, 145 insertions(+), 143 deletions(-) diff --git a/dist/assets/css/search.css b/dist/assets/css/search.css index 0e7d437..dc3e54b 100755 --- a/dist/assets/css/search.css +++ b/dist/assets/css/search.css @@ -7,9 +7,9 @@ max-width: 500px; } -.form-group-simple.hidden, -.form-group-structured.hidden { - display: none; +.tab-content { + border: 1px solid #ddd; + border-top: none; } form #q { diff --git a/dist/assets/js/nominatim-ui.js b/dist/assets/js/nominatim-ui.js index 05019aa..9fff0c7 100644 --- a/dist/assets/js/nominatim-ui.js +++ b/dist/assets/js/nominatim-ui.js @@ -428,20 +428,6 @@ function init_map_on_search_page(is_reverse_search, nominatim_results, request_l update_viewbox_field(); }); - $("input[name='query-selector']").click(function () { - var query_val = $("input[name='query-selector']:checked").val(); - if (query_val === 'simple') { - $('div.form-group-simple').removeClass('hidden'); - $('div.form-group-structured').addClass('hidden'); - $('.form-group-structured').find('input:text').val(''); - } else if (query_val === 'structured') { - console.log('here'); - $('div.form-group-simple').addClass('hidden'); - $('div.form-group-structured').removeClass('hidden'); - $('.form-group-simple').find('input:text').val(''); - } - }); - function get_result_element(position) { return $('.result').eq(position); } diff --git a/dist/search.html b/dist/search.html index afb6c33..e8aa46a 100644 --- a/dist/search.html +++ b/dist/search.html @@ -130,32 +130,41 @@ {{/inline}} -
- -
- - -
-
- - -
- -