X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/blobdiff_plain/0ba857ac4c4edb839832b63010ca8550da701da5..502749ba0bdd92a4c0c2cec23a0f27155f873036:/src/pages/SearchPage.svelte

diff --git a/src/pages/SearchPage.svelte b/src/pages/SearchPage.svelte
index 802034f..134ea8a 100644
--- a/src/pages/SearchPage.svelte
+++ b/src/pages/SearchPage.svelte
@@ -1,6 +1,5 @@
 <script>
   import { page, results_store } from '../lib/stores.js';
-  import { get_config_value } from '../lib/config_reader.js';
   import { fetch_from_api, update_html_title } from '../lib/api_utils.js';
 
   import Header from '../components/Header.svelte';
@@ -23,7 +22,7 @@
       state: search_params.get('state'),
       country: search_params.get('country'),
       postalcode: search_params.get('postalcode'),
-      polygon_geojson: get_config_value('Search_AreaPolygons', false) ? 1 : 0,
+      polygon_geojson: Nominatim_Config.Search_AreaPolygons ? 1 : 0,
       viewbox: search_params.get('viewbox'),
       bounded: search_params.get('bounded'),
       dedupe: search_params.get('dedupe'),
@@ -48,7 +47,12 @@
 
         update_html_title('Result for ' + api_request_params.q);
 
-        document.querySelector('input[name=q]').focus();
+        if (anyStructuredFieldsSet) {
+          document.querySelector(".nav-tabs a[href='#structured']").click();
+          document.querySelector('input[name=street]').focus();
+        } else {
+          document.querySelector('input[name=q]').focus();
+        }
       });
     } else {
       results_store.set(undefined);
