Correctly handle touch PointerEvents

`onPointerDown/Up` may call `capture/releasePointer`
with `"touch"` as the pointerType, which would result
in a bug as `touchCount` would be `undefined`.

`capture/releasePointer` should just default to a
count of `1` if not specified. This properly retains
the existing behaviour for non-TouchEvent handling.
This commit is contained in:
Daniel Zimmermann 2016-05-14 22:16:36 +10:00
parent a4dbae0754
commit c25bf0a239

View File

@ -1357,11 +1357,11 @@
* @private
* @inner
*/
function capturePointer( tracker, pointerType, touchCount ) {
function capturePointer( tracker, pointerType, pointerCount ) {
var pointsList = tracker.getActivePointersListByType( pointerType ),
eventParams;
pointsList.captureCount += (pointerType === 'touch' ? touchCount : 1);
pointsList.captureCount += (pointerCount || 1);
if ( pointsList.captureCount === 1 ) {
if ( $.Browser.vendor === $.BROWSERS.IE && $.Browser.version < 9 ) {
@ -1400,11 +1400,11 @@
* @private
* @inner
*/
function releasePointer( tracker, pointerType, touchCount ) {
function releasePointer( tracker, pointerType, pointerCount ) {
var pointsList = tracker.getActivePointersListByType( pointerType ),
eventParams;
pointsList.captureCount -= (pointerType === 'touch' ? touchCount : 1);
pointsList.captureCount -= (pointerCount || 1);
if ( pointsList.captureCount === 0 ) {
if ( $.Browser.vendor === $.BROWSERS.IE && $.Browser.version < 9 ) {