src/mousetracker.js
/**
     * Begin capturing pointer events to the tracked element.
     * @private
     * @inner
     */
Begin capturing pointer events to the tracked element.
@private
@inner
Begin capturing pointer events to the tracked element . @private @inner
function capturePointer( tracker, gPoint ) {
        var eventParams;
        if ( $.MouseTracker.havePointerCapture ) {
            if ( $.MouseTracker.havePointerEvents ) {
                try {
                    tracker.element.setPointerCapture( gPoint.id );
                } catch ( e ) {
                    $.console.warn('setPointerCapture() called on invalid pointer ID');
                    return;
                }
            } else {
                tracker.element.setCapture( true );
            }
        } else {
            eventParams = getCaptureEventParams( tracker, $.MouseTracker.havePointerEvents ? 'pointerevent' : gPoint.type );
            if (isInIframe && canAccessEvents(window.top)) {
                $.addEvent(
                    window.top,
                    eventParams.upName,
                    eventParams.upHandler,
                    true
                );
            }
            $.addEvent(
                $.MouseTracker.captureElement,
                eventParams.upName,
                eventParams.upHandler,
                true
            );
            $.addEvent(
                $.MouseTracker.captureElement,
                eventParams.moveName,
                eventParams.moveHandler,
                true
            );
        }
        updatePointerCaptured( tracker, gPoint, true );
    }
function capturePointer ( tracker , gPoint ) { var eventParams ; if ( $ . MouseTracker . havePointerCapture ) { if ( $ . MouseTracker . havePointerEvents ) { try { tracker . element . setPointerCapture ( gPoint . id ) ; } catch ( e ) { $ . console . warn ( 'setPointerCapture() called on invalid pointer ID' ) ; return ; } } else { tracker . element . setCapture ( true ) ; } } else { eventParams = getCaptureEventParams ( tracker , $ . MouseTracker . havePointerEvents ? 'pointerevent' : gPoint . type ) ; if ( isInIframe && canAccessEvents ( window . top ) ) { $ . addEvent ( window . top , eventParams . upName , eventParams . upHandler , true ) ; } $ . addEvent ( $ . MouseTracker . captureElement , eventParams . upName , eventParams . upHandler , true ) ; $ . addEvent ( $ . MouseTracker . captureElement , eventParams . moveName , eventParams . moveHandler , true ) ; } updatePointerCaptured ( tracker , gPoint , true ) ; }
Begin capturing pointer events to the tracked element.
Begin capturing pointer events to the tracked element .
// Can throw NotFoundError (InvalidPointerId Firefox < 82) //   (should never happen so we'll log a warning) //$.console.log('element.setPointerCapture() called'); //$.console.log('element.setCapture() called'); // Emulate mouse capture by hanging listeners on the document object. //    (Note we listen on the capture phase so the captured handlers will get called first) // eslint-disable-next-line no-use-before-define //$.console.log('Emulated mouse capture set'); // https://github.com/openseadragon/openseadragon/pull/790