mirror of
https://github.com/openseadragon/openseadragon.git
synced 2025-02-23 18:23:13 +03:00
Changed hasScrollHandler to be a function to better work with dynamically added handlers
Previously, we were setting hasScrollHandler once in the constructor and never re-assigning it after the initial creation. Changing hasScrollHandler to a function better accommodates dynamically added/removed handlers. See previous commit for change to hasGestureHandlers for further details and reasoning.
This commit is contained in:
parent
865c3884b2
commit
9527f15f52
@ -277,8 +277,6 @@
|
|||||||
sentDragEvent: false
|
sentDragEvent: false
|
||||||
};
|
};
|
||||||
|
|
||||||
this.hasScrollHandler = !!this.scrollHandler;
|
|
||||||
|
|
||||||
if ( $.MouseTracker.havePointerEvents ) {
|
if ( $.MouseTracker.havePointerEvents ) {
|
||||||
$.setElementPointerEvents( this.element, 'auto' );
|
$.setElementPointerEvents( this.element, 'auto' );
|
||||||
}
|
}
|
||||||
@ -403,6 +401,15 @@
|
|||||||
this.pinchHandler);
|
this.pinchHandler);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Do we currently have a scroll handler.
|
||||||
|
* @function
|
||||||
|
* @returns {Boolean} Do we currently have a scroll handler.
|
||||||
|
*/
|
||||||
|
hasScrollHandler: function () {
|
||||||
|
return !!this.scrollHandler;
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implement or assign implementation to these handlers during or after
|
* Implement or assign implementation to these handlers during or after
|
||||||
* calling the constructor.
|
* calling the constructor.
|
||||||
@ -2881,7 +2888,7 @@
|
|||||||
eventInfo.isStoppable = true;
|
eventInfo.isStoppable = true;
|
||||||
eventInfo.isCancelable = true;
|
eventInfo.isCancelable = true;
|
||||||
eventInfo.preventDefault = false; // handleWheelEvent() may set true
|
eventInfo.preventDefault = false; // handleWheelEvent() may set true
|
||||||
eventInfo.preventGesture = !tracker.hasScrollHandler;
|
eventInfo.preventGesture = !tracker.hasScrollHandler();
|
||||||
eventInfo.stopPropagation = false;
|
eventInfo.stopPropagation = false;
|
||||||
break;
|
break;
|
||||||
case 'gotpointercapture':
|
case 'gotpointercapture':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user