mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-24 22:26:10 +03:00
Code cleanup, better scrollHandler handling in Viewer
This commit is contained in:
parent
23d00c92c1
commit
870d9df779
@ -2089,7 +2089,6 @@
|
||||
if ( eventInfo.stopPropagation ) {
|
||||
$.stopEvent( originalEvent );
|
||||
}
|
||||
//if ( eventInfo.preventDefault && !eventInfo.defaultPrevented ) {
|
||||
if ( ( eventArgs && eventArgs.preventDefault ) || ( eventInfo.preventDefault && !eventInfo.defaultPrevented ) ) {
|
||||
$.cancelEvent( originalEvent );
|
||||
}
|
||||
|
@ -3224,7 +3224,8 @@ function onCanvasScroll( event ) {
|
||||
scroll: event.scroll,
|
||||
shift: event.shift,
|
||||
originalEvent: event.originalEvent,
|
||||
preventDefaultAction: false
|
||||
preventDefaultAction: false,
|
||||
preventDefault: true
|
||||
};
|
||||
|
||||
/**
|
||||
@ -3240,6 +3241,7 @@ function onCanvasScroll( event ) {
|
||||
* @property {Boolean} shift - True if the shift key was pressed during this event.
|
||||
* @property {Object} originalEvent - The original DOM event.
|
||||
* @property {Boolean} preventDefaultAction - Set to true to prevent default scroll to zoom behaviour. Default: false.
|
||||
* @property {Boolean} preventDefault - Set to true to prevent the default user-agent's handling of the wheel event. Default: true.
|
||||
* @property {?Object} userData - Arbitrary subscriber-defined object.
|
||||
*/
|
||||
this.raiseEvent('canvas-scroll', canvasScrollEventArgs );
|
||||
@ -3259,9 +3261,11 @@ function onCanvasScroll( event ) {
|
||||
this.viewport.applyConstraints();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
event.preventDefault = true;
|
||||
event.preventDefault = canvasScrollEventArgs.preventDefault;
|
||||
} else {
|
||||
event.preventDefault = true;
|
||||
}
|
||||
}
|
||||
|
||||
function onContainerEnter( event ) {
|
||||
|
Loading…
Reference in New Issue
Block a user