]> git.ardis.lu - ardislu.dev/commitdiff
Use ID on refresh button to clarify event listener
authorArdis Lu <ardisglu@gmail.com>
Sun, 14 Aug 2022 06:07:23 +0000 (23:07 -0700)
committerArdis Lu <ardisglu@gmail.com>
Sun, 14 Aug 2022 06:07:23 +0000 (23:07 -0700)
index.html
script.js

index be066a24fa69141d324efd75e298916aa9621b1e..29d10a12af9476ddce6803fd6902922077ef3741 100644 (file)
@@ -71,7 +71,7 @@
 
   <dialog>
     <p>A newer version of this page is available.</p>
-    <button>Refresh</button>
+    <button id="refresh">Refresh</button>
   </dialog>
 
   <script type="module" src="/script.js"></script>
index 99b3bbf37bbd2fef97826d7c60509accb47cc485..9f9cd521129209cf7492d1d90a209ff155e6391c 100644 (file)
--- a/script.js
+++ b/script.js
@@ -13,7 +13,7 @@ cacheChannel.addEventListener('message', e => {
     globalThis.components.get('toast').show();
   }
 });
-document.querySelector('dialog > button').addEventListener('click', _ => location.reload());
+document.querySelector('#refresh').addEventListener('click', _ => location.reload());
 
 /* Global store for homepage metadata and HTML components. */
 globalThis.metadata = new Map();
This page took 0.054442 seconds and 4 git commands to generate.