@@ -83,6 +83,11 @@ IonicModule
83
83
screenY : e . screenY
84
84
} ] ;
85
85
86
+ // Force mouse events to have had a down event first
87
+ if ( ! startY && e . type == 'mousemove' ) {
88
+ return ;
89
+ }
90
+
86
91
// if multitouch or regular scroll event, get out immediately
87
92
if ( ! canOverscroll || e . touches . length > 1 ) {
88
93
return ;
@@ -252,6 +257,21 @@ IonicModule
252
257
}
253
258
254
259
260
+ var touchStartEvent , touchMoveEvent , touchEndEvent ;
261
+ if ( window . navigator . pointerEnabled ) {
262
+ touchStartEvent = 'pointerdown' ;
263
+ touchMoveEvent = 'pointermove' ;
264
+ touchEndEvent = 'pointerup' ;
265
+ } else if ( window . navigator . msPointerEnabled ) {
266
+ touchStartEvent = 'MSPointerDown' ;
267
+ touchMoveEvent = 'MSPointerMove' ;
268
+ touchEndEvent = 'MSPointerUp' ;
269
+ } else {
270
+ touchStartEvent = 'touchstart' ;
271
+ touchMoveEvent = 'touchmove' ;
272
+ touchEndEvent = 'touchend' ;
273
+ }
274
+
255
275
self . init = function ( ) {
256
276
scrollParent = $element . parent ( ) . parent ( ) [ 0 ] ;
257
277
scrollChild = $element . parent ( ) [ 0 ] ;
@@ -261,8 +281,9 @@ IonicModule
261
281
throw new Error ( 'Refresher must be immediate child of ion-content or ion-scroll' ) ;
262
282
}
263
283
264
- ionic . on ( 'touchmove' , handleTouchmove , scrollChild ) ;
265
- ionic . on ( 'touchend' , handleTouchend , scrollChild ) ;
284
+
285
+ ionic . on ( touchMoveEvent , handleTouchmove , scrollChild ) ;
286
+ ionic . on ( touchEndEvent , handleTouchend , scrollChild ) ;
266
287
ionic . on ( 'mousedown' , handleMousedown , scrollChild ) ;
267
288
ionic . on ( 'mousemove' , handleTouchmove , scrollChild ) ;
268
289
ionic . on ( 'mouseup' , handleTouchend , scrollChild ) ;
@@ -273,8 +294,8 @@ IonicModule
273
294
} ;
274
295
275
296
function destroy ( ) {
276
- ionic . off ( 'touchmove' , handleTouchmove , scrollChild ) ;
277
- ionic . off ( 'touchend' , handleTouchend , scrollChild ) ;
297
+ ionic . off ( touchMoveEvent , handleTouchmove , scrollChild ) ;
298
+ ionic . off ( touchEndEvent , handleTouchend , scrollChild ) ;
278
299
ionic . off ( 'mousedown' , handleMousedown , scrollChild ) ;
279
300
ionic . off ( 'mousemove' , handleTouchmove , scrollChild ) ;
280
301
ionic . off ( 'mouseup' , handleTouchend , scrollChild ) ;
0 commit comments