]> git.openstreetmap.org Git - nominatim-ui.git/commitdiff
use svelte syntax for setting the popstate handler
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 5 Feb 2021 22:32:44 +0000 (23:32 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 5 Feb 2021 22:32:44 +0000 (23:32 +0100)
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();
-};