Merge pull request #2649 from Seafret/master

Fixed issue with MouseTracker where hasGestureHandlers and hasScrollHandler values were not getting updated upon dynamically adding/removing handlers.
This commit is contained in:
Ian Gilman 2025-01-09 09:42:51 -08:00 committed by GitHub
commit 3aaa8fa721
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -277,13 +277,6 @@
sentDragEvent: false
};
this.hasGestureHandlers = !!( this.pressHandler || this.nonPrimaryPressHandler ||
this.releaseHandler || this.nonPrimaryReleaseHandler ||
this.clickHandler || this.dblClickHandler ||
this.dragHandler || this.dragEndHandler ||
this.pinchHandler );
this.hasScrollHandler = !!this.scrollHandler;
if ( $.MouseTracker.havePointerEvents ) {
$.setElementPointerEvents( this.element, 'auto' );
}
@ -391,6 +384,30 @@
return count;
},
/**
* Do we currently have any assigned gesture handlers.
* @returns {Boolean} Do we currently have any assigned gesture handlers.
*/
get hasGestureHandlers() {
return !!(this.pressHandler ||
this.nonPrimaryPressHandler ||
this.releaseHandler ||
this.nonPrimaryReleaseHandler ||
this.clickHandler ||
this.dblClickHandler ||
this.dragHandler ||
this.dragEndHandler ||
this.pinchHandler);
},
/**
* Do we currently have a scroll handler.
* @returns {Boolean} Do we currently have a scroll handler.
*/
get hasScrollHandler() {
return !!this.scrollHandler;
},
/**
* Implement or assign implementation to these handlers during or after
* calling the constructor.