]> git.openstreetmap.org Git - nominatim-ui.git/commitdiff
Merge pull request #55 from lonvia/sveltify-popstate
authormtmail <mtmail@gmx.net>
Sat, 6 Feb 2021 20:26:35 +0000 (21:26 +0100)
committerGitHub <noreply@github.com>
Sat, 6 Feb 2021 20:26:35 +0000 (21:26 +0100)
Use svelte syntax for setting the popstate handler

src/App.svelte
src/main.js

index e543afd471564dfe7cc591a0dd1ea0de05c724f9..3e64b165dac64752dcceac5409304cd8c7c6ee90 100644 (file)
@@ -18,6 +18,9 @@
   refresh_page();
 </script>
 
+// deal with back-button and other user action
+<svelte:window on:popstate={refresh_page} />
+
 <Header/>
 {#if view === 'search'}
 <SearchPage />
index f0450596a80e51b6dee2f5a41f805bba9debf751..a8269c6c44c729102b49b416de6c293a5afbf83a 100644 (file)
@@ -41,8 +41,3 @@ document.addEventListener('click', function (e) {
     }
   }
 });
-
-// deal with back-button and other user action
-window.onpopstate = function () {
-  refresh_page();
-};