X-Git-Url: https://git.openstreetmap.org./nominatim-ui.git/blobdiff_plain/9e8d3367fe08a708b1019ff39ac752e0105be20a..64e1ec4d0f152bc9a279c2f016a111f9943dc6a4:/src/components/PageLink.svelte

diff --git a/src/components/PageLink.svelte b/src/components/PageLink.svelte
index 9205c2f..df124f7 100644
--- a/src/components/PageLink.svelte
+++ b/src/components/PageLink.svelte
@@ -1,11 +1,19 @@
 <script>
-import { refresh_page } from '../lib/stores.js';
+  import { refresh_page } from '../lib/stores.js';
 
-export let page;
+  export let page;
+  export let params_hash = {};
+  export let extra_classes = '';
+  let href = page + '.html';
 
-function handleClick() {
-  refresh_page(page);
-}
+  function handleClick() {
+    refresh_page(page, new URLSearchParams(params_hash));
+  }
+
+  $: {
+    let param_str = new URLSearchParams(params_hash).toString();
+    href = page + '.html' + (param_str ? '?' : '') + param_str;
+  }
 </script>
 
-<a on:click|preventDefault|stopPropagation={handleClick} href="{page}.html"><slot></slot></a>
+<a on:click|preventDefault|stopPropagation={handleClick} href={href} class={extra_classes}><slot></slot></a>
