Fixed tests to account for #1459 fix (fire drag-end event even if pointer didn't move)

This commit is contained in:
Mark Salsbery 2020-08-13 19:56:22 -07:00
parent 6b500f1ff2
commit 3769af532b
3 changed files with 13 additions and 4 deletions

View File

@ -2048,7 +2048,7 @@ function OpenSeadragon( options ){
},
/**
* COnvert passed addEventListener() options to boolean or options object,
* Convert passed addEventListener() options to boolean or options object,
* depending on browser support.
* @function
* @param {Boolean|Object} [options] Boolean useCapture, or if [supportsEventListenerOptions]{@link OpenSeadragon.supportsEventListenerOptions}, can be an object

View File

@ -12,6 +12,7 @@
}
$.MouseTracker.havePointerEvents = false;
$.MouseTracker.unprefixedPointerEvents = true;
$.MouseTracker.subscribeEvents.push( "mouseenter", "mouseleave" );
if ( $.Browser.vendor !== $.BROWSERS.IE || $.Browser.version > 8 ) {
$.MouseTracker.subscribeEvents.push( "mouseover", "mouseout" );
@ -20,6 +21,15 @@
$.MouseTracker.havePointerOverOut = false;
}
$.MouseTracker.subscribeEvents.push( "mousedown", "mouseup", "mousemove" );
$.MouseTracker.mousePointerId = "legacy-mouse";
// Legacy mouse events capture support (IE/Firefox only?)
$.MouseTracker.havePointerCapture = (function () {
var divElement = document.createElement( 'div' );
return $.isFunction( divElement.setCapture ) && $.isFunction( divElement.releaseCapture );
}());
if ( $.MouseTracker.havePointerCapture ) {
$.MouseTracker.subscribeEvents.push( "losecapture" );
}
if ( 'ontouchstart' in window ) {
// iOS, Android, and other W3c Touch Event implementations
// (see http://www.w3.org/TR/touch-events/)
@ -32,6 +42,5 @@
// Subscribe to these to prevent default gesture handling
$.MouseTracker.subscribeEvents.push( "gesturestart", "gesturechange" );
}
$.MouseTracker.mousePointerId = "legacy-mouse";
}(OpenSeadragon));

View File

@ -452,7 +452,7 @@
clickCount: 2,
dblClickCount: 1,
dragCount: 0,
dragEndCount: 0,
dragEndCount: 2, // v2.5.0+ drag-end event now fired even if pointer didn't move (#1459)
insideElementPressed: true,
insideElementReleased: true,
contacts: 0,
@ -480,7 +480,7 @@
clickCount: 1,
dblClickCount: 0,
dragCount: 0,
dragEndCount: 0,
dragEndCount: 1, // v2.5.0+ drag-end event now fired even if pointer didn't move (#1459)
insideElementPressed: true,
insideElementReleased: true,
contacts: 0,