--
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
const linkSelectors = 'a, button, [role="button"], input[type="submit"], input[type="button"]';
|
||||
const padding = 6;
|
||||
|
||||
const ac = new AbortController();
|
||||
const sig = ac.signal;
|
||||
let ac = null;
|
||||
let sig = null;
|
||||
|
||||
let mouseX = 0, mouseY = 0;
|
||||
let currentLinkEl = null;
|
||||
@@ -16,7 +16,7 @@
|
||||
const TOUCH_MOUSE_GUARD_MS = 800;
|
||||
|
||||
window.__scriptCleanup = () => {
|
||||
ac.abort();
|
||||
if (ac) ac.abort();
|
||||
if (rafId) { cancelAnimationFrame(rafId); rafId = null; }
|
||||
document.documentElement.style.cursor = '';
|
||||
if (cursor) cursor.classList.remove('visible', 'on-link', 'on-text');
|
||||
@@ -66,6 +66,9 @@
|
||||
document.documentElement.style.cursor = 'none';
|
||||
|
||||
function init() {
|
||||
ac = new AbortController();
|
||||
sig = ac.signal;
|
||||
|
||||
cursor = document.getElementById('cursor');
|
||||
if (!cursor) return;
|
||||
|
||||
@@ -279,6 +282,8 @@
|
||||
cursor.classList.add('on-text');
|
||||
}
|
||||
}
|
||||
|
||||
init();
|
||||
});
|
||||
}, { signal: sig });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user