mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-25 06:36:11 +03:00
Fixed simulated drag events in navigator tests
This commit is contained in:
parent
a520da0d55
commit
5eea11e2a5
@ -35,6 +35,7 @@ OPENSEADRAGON CHANGELOG
|
|||||||
* MouseTracker: Per #1863, dropped support for Internet Explorer < 11 (#1872 @msalsbery)
|
* MouseTracker: Per #1863, dropped support for Internet Explorer < 11 (#1872 @msalsbery)
|
||||||
* Dropped support for older browsers (IE < 11) (#1949 @msalsbery)
|
* Dropped support for older browsers (IE < 11) (#1949 @msalsbery)
|
||||||
* Removed deprecated OpenSeadragon.getEvent function (#1949 @msalsbery)
|
* Removed deprecated OpenSeadragon.getEvent function (#1949 @msalsbery)
|
||||||
|
* Fixed simulated drag events in navigator tests (#1949 @msalsbery)
|
||||||
|
|
||||||
2.4.2:
|
2.4.2:
|
||||||
|
|
||||||
|
@ -222,13 +222,26 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
var simulateNavigatorDrag = function (viewer, distanceX, distanceY) {
|
var simulateNavigatorDrag = function (viewer, distanceX, distanceY) {
|
||||||
var $canvas = $(viewer.element).find('.displayregion'),
|
var $canvas = $(viewer.element).find('.openseadragon-canvas'),
|
||||||
event = {
|
offset = $canvas.offset(),
|
||||||
dx: Math.floor(distanceX),
|
event = {};
|
||||||
dy: Math.floor(distanceY)
|
|
||||||
};
|
event.clientX = offset.left + 1;
|
||||||
$canvas
|
event.clientY = offset.top + 1;
|
||||||
.simulate('drag', event);
|
$canvas.simulate( 'mouseenter', event );
|
||||||
|
|
||||||
|
event.button = 0;
|
||||||
|
$canvas.simulate( 'mousedown', event );
|
||||||
|
|
||||||
|
event.clientX += distanceX;
|
||||||
|
event.clientY += distanceY;
|
||||||
|
$canvas.simulate( 'mousemove', event );
|
||||||
|
|
||||||
|
event.button = 0;
|
||||||
|
$canvas.simulate( 'mouseup', event );
|
||||||
|
|
||||||
|
event.relatedTarget = document.body;
|
||||||
|
$canvas.simulate( 'mouseleave', event );
|
||||||
};
|
};
|
||||||
|
|
||||||
var dragNavigatorBackToCenter = function () {
|
var dragNavigatorBackToCenter = function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user