From 365e7f1e9b9aaf36769990654def404ce8fa5cff Mon Sep 17 00:00:00 2001 From: mtmail Date: Thu, 8 Apr 2021 17:40:49 +0200 Subject: [PATCH] Switched to structured form when URL contains structured fields (#115) --- src/pages/SearchPage.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/SearchPage.svelte b/src/pages/SearchPage.svelte index 6f10f74..134ea8a 100644 --- a/src/pages/SearchPage.svelte +++ b/src/pages/SearchPage.svelte @@ -47,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); -- 2.39.5