mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-28 16:16:08 +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 ) {
|
if ( eventInfo.stopPropagation ) {
|
||||||
$.stopEvent( originalEvent );
|
$.stopEvent( originalEvent );
|
||||||
}
|
}
|
||||||
//if ( eventInfo.preventDefault && !eventInfo.defaultPrevented ) {
|
|
||||||
if ( ( eventArgs && eventArgs.preventDefault ) || ( eventInfo.preventDefault && !eventInfo.defaultPrevented ) ) {
|
if ( ( eventArgs && eventArgs.preventDefault ) || ( eventInfo.preventDefault && !eventInfo.defaultPrevented ) ) {
|
||||||
$.cancelEvent( originalEvent );
|
$.cancelEvent( originalEvent );
|
||||||
}
|
}
|
||||||
|
@ -3224,7 +3224,8 @@ function onCanvasScroll( event ) {
|
|||||||
scroll: event.scroll,
|
scroll: event.scroll,
|
||||||
shift: event.shift,
|
shift: event.shift,
|
||||||
originalEvent: event.originalEvent,
|
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 {Boolean} shift - True if the shift key was pressed during this event.
|
||||||
* @property {Object} originalEvent - The original DOM 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} 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.
|
* @property {?Object} userData - Arbitrary subscriber-defined object.
|
||||||
*/
|
*/
|
||||||
this.raiseEvent('canvas-scroll', canvasScrollEventArgs );
|
this.raiseEvent('canvas-scroll', canvasScrollEventArgs );
|
||||||
@ -3259,10 +3261,12 @@ function onCanvasScroll( event ) {
|
|||||||
this.viewport.applyConstraints();
|
this.viewport.applyConstraints();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
event.preventDefault = canvasScrollEventArgs.preventDefault;
|
||||||
|
} else {
|
||||||
event.preventDefault = true;
|
event.preventDefault = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function onContainerEnter( event ) {
|
function onContainerEnter( event ) {
|
||||||
THIS[ this.hash ].mouseInside = true;
|
THIS[ this.hash ].mouseInside = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user