mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 14:46:10 +03:00
setPointerCapture/releasePointerCapture exception handling
This commit is contained in:
parent
c22e624a3d
commit
5360e65ee9
@ -1620,12 +1620,18 @@
|
||||
|
||||
if ( $.MouseTracker.havePointerCapture ) {
|
||||
if ( $.MouseTracker.havePointerEvents ) {
|
||||
if ( $.MouseTracker.unprefixedPointerEvents ) {
|
||||
tracker.element.setPointerCapture( gPoint.id );
|
||||
//$.console.log('element.setPointerCapture() called');
|
||||
} else {
|
||||
tracker.element.msSetPointerCapture( gPoint.id );
|
||||
//$.console.log('element.msSetPointerCapture() called');
|
||||
// Can throw InvalidPointerId
|
||||
// (should never happen for setPointerCapture so we'll log a warning)
|
||||
try {
|
||||
if ( $.MouseTracker.unprefixedPointerEvents ) {
|
||||
tracker.element.setPointerCapture( gPoint.id );
|
||||
//$.console.log('element.setPointerCapture() called');
|
||||
} else {
|
||||
tracker.element.msSetPointerCapture( gPoint.id );
|
||||
//$.console.log('element.msSetPointerCapture() called');
|
||||
}
|
||||
} catch ( e ) {
|
||||
$.console.warn('setPointerCapture() called on invalid pointer ID');
|
||||
}
|
||||
} else {
|
||||
tracker.element.setCapture( true );
|
||||
@ -1674,12 +1680,19 @@
|
||||
|
||||
if ( $.MouseTracker.havePointerCapture ) {
|
||||
if ( $.MouseTracker.havePointerEvents ) {
|
||||
if ( $.MouseTracker.unprefixedPointerEvents ) {
|
||||
tracker.element.releasePointerCapture( gPoint.id );
|
||||
//$.console.log('element.releasePointerCapture() called');
|
||||
} else {
|
||||
tracker.element.msReleasePointerCapture( gPoint.id );
|
||||
//$.console.log('element.msReleasePointerCapture() called');
|
||||
// Can throw InvalidPointerId
|
||||
// (can happen depending on browser event timing (Firefox touch)
|
||||
// so we won't log a warning)
|
||||
try {
|
||||
if ( $.MouseTracker.unprefixedPointerEvents ) {
|
||||
tracker.element.releasePointerCapture( gPoint.id );
|
||||
//$.console.log('element.releasePointerCapture() called');
|
||||
} else {
|
||||
tracker.element.msReleasePointerCapture( gPoint.id );
|
||||
//$.console.log('element.msReleasePointerCapture() called');
|
||||
}
|
||||
} catch ( e ) {
|
||||
/* eslint-disable no-empty */
|
||||
}
|
||||
} else {
|
||||
tracker.element.releaseCapture();
|
||||
|
Loading…
Reference in New Issue
Block a user