MediaWiki:Gadget-GrAnnotations.js: Difference between revisions
No edit summary |
No edit summary |
||
| Line 656: | Line 656: | ||
}); | }); | ||
/* ── Mobile: | /* ── Mobile: touchend triggers selection check ── | ||
* | * On Minerva, selectionchange fires during drag but the range | ||
* | * isn't stable until touchend. We listen for touchend too and | ||
* ( | * check after a short delay for the selection to settle. */ | ||
document.addEventListener('touchend', function() { | |||
if (!_mobile) return; | |||
clearTimeout(_selTimer); | |||
_selTimer = setTimeout(tryShowActions, 400); | |||
}, { passive: true }); | |||
/* ── selectionchange debounced 600ms ── */ | |||
var _selTimer = null; | var _selTimer = null; | ||
document.addEventListener('selectionchange', function() { | document.addEventListener('selectionchange', function() { | ||
| Line 669: | Line 676: | ||
if (_fabSelVer === v) return; | if (_fabSelVer === v) return; | ||
tryShowActions(); | tryShowActions(); | ||
}, | }, 600); | ||
}); | }); | ||