From a212487613baf2bce95add6e1f74f40ef7f8dca9 Mon Sep 17 00:00:00 2001 From: Rhiannon Morris Date: Sun, 16 Aug 2020 11:28:16 +0200 Subject: [PATCH] location is a global also --- script/gallery.js | 2 +- script/single.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/script/gallery.js b/script/gallery.js index 98d82f9..72cf12e 100644 --- a/script/gallery.js +++ b/script/gallery.js @@ -81,7 +81,7 @@ function makeFragment() { } function useFragment(firstLoad) { - let frag = document.location.hash.replace(/^#/, ''); + let frag = location.hash.replace(/^#/, ''); if (frag == 'all') { clearForm(); diff --git a/script/single.js b/script/single.js index 3902da9..a40d5b0 100644 --- a/script/single.js +++ b/script/single.js @@ -60,7 +60,7 @@ function activateButton(button, doPush = true, firstLoad = false) { function useFragment(firstLoad = false) { let button = document.querySelector('#alts input'); - let frag = document.location.hash.replace(/^#/, ''); + let frag = location.hash.replace(/^#/, ''); if (frag) { let button0 = document.getElementById(frag); if (button0) button = button0;