1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-23 18:53:36 +02:00

Desktop: Reset window hash to allow clicking an anchor multiple times (#4538)

This commit is contained in:
Caleb John 2021-02-23 03:59:08 -07:00 committed by GitHub
parent 80cb18ca90
commit da9da7ec62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -395,6 +395,16 @@
}
}
window.addEventListener('hashchange', webviewLib.logEnabledEventHandler(e => {
if (!window.location.hash) return;
// The timeout is necessary to prevent a race condition and give time for the window to scroll
setTimeout(() => {
// Reset the window hash to allow clicking on the same anchor link more than once
window.location.hash = '';
}, 100);
}));
document.addEventListener('contextmenu', webviewLib.logEnabledEventHandler(event => {
let element = event.target;