~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
3 2

[PATCH gddo v2] Fix onhashchange event listener

Details
Message ID
<20210114151011.6617-1-me@adnano.co>
DKIM signature
pass
Download raw message
Patch: +3 -3
---
This uses addEventListener instead of setting the onhashchange property.

 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..d761d3b 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()
window.addEventListener("hashchange", onhashchange)
onhashchange()
-- 
2.30.0
Details
Message ID
<20210114194702.zzwoyidtiwx4gmid@localhost>
In-Reply-To
<20210114151011.6617-1-me@adnano.co> (view parent)
DKIM signature
pass
Download raw message
> +function onhashchange() {

I don't really like that name. What about handleHashChange?
Details
Message ID
<C8J52MT53H0W.3DW5W65PF1TBJ@taiga>
In-Reply-To
<20210114194702.zzwoyidtiwx4gmid@localhost> (view parent)
DKIM signature
pass
Download raw message
On Thu Jan 14, 2021 at 2:47 PM EST, Alexey wrote:
> > +function onhashchange() {
>
> I don't really like that name. What about handleHashChange?

NACK, go to bikeshedding jail.
Details
Message ID
<C8J52RWCNAM0.1CBYXCOIB1WI2@taiga>
In-Reply-To
<20210114151011.6617-1-me@adnano.co> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
Thanks!

To git@git.sr.ht:~sircmpwn/gddo
   9c1d4f5..0b015cb  master -> master
Reply to thread Export thread (mbox)