~sircmpwn/public-inbox

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH gddo] Fix onhashchange event listener

Details
Message ID
<20210113160520.20835-1-me@adnano.co>
DKIM signature
pass
Download raw message
Patch: +3 -3
---
 gddo-server/assets/site.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gddo-server/assets/site.js b/gddo-server/assets/site.js
index 7beb5f1..d8170c9 100644
--- a/gddo-server/assets/site.js
+++ b/gddo-server/assets/site.js
@@ -239,12 +239,12 @@ document.onkeydown = function(e) {
	return true
}

function onhashchanged() {
function onhashchange() {
	// open selected example
	var hash = window.location.hash
	if (hash.startsWith("#example-")) {
		document.querySelector(hash).parentElement.setAttribute("open", "")
	}
}
window.onhashchanged = onhashchanged
onhashchanged()
document.body.onhashchange = onhashchange
onhashchange()
-- 
2.30.0
Details
Message ID
<20210114134027.pywf5uk2payftd5n@localhost>
In-Reply-To
<20210113160520.20835-1-me@adnano.co> (view parent)
DKIM signature
pass
Download raw message
> +document.body.onhashchange = onhashchange

Why not addEventListener?
Details
Message ID
<C8IXBC28SWD9.25G49COWU3HD2@taiga>
In-Reply-To
<20210113160520.20835-1-me@adnano.co> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
I agree that this should use addEventListener.
Reply to thread Export thread (mbox)