Monorepo for Tangled
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

appview/pages: fix element cleanup in permalink shortcut

Signed-off-by: oppiliappan <me@oppi.li>

authored by

oppiliappan and committed by
Tangled
9afe7ce0 62b92023

+4 -1
+4 -1
appview/pages/templates/repo/fragments/permalinkShortcut.html
··· 3 3 (() => { 4 4 {{ if .LastCommitInfo }} 5 5 const abortController = new AbortController(); 6 + const scriptEl = document.currentScript; 6 7 document.addEventListener('keydown', (e) => { 7 8 if(e.key === 'y' && !e.ctrlKey && !e.metaKey && !e.altKey) { 8 9 if(e.target.tagName === 'INPUT' || e.target.tagName === 'TEXTAREA') return; ··· 12 13 }, {signal: abortController.signal}); 13 14 14 15 document.body.addEventListener('htmx:beforeCleanupElement', (e) => { 15 - abortController.abort(); 16 + if(e.target === scriptEl) { 17 + abortController.abort(); 18 + } 16 19 }, {signal: abortController.signal}); 17 20 {{ end }} 18 21 })();