@@ -39,6 +39,15 @@ IonicModule
39
39
$onPulling : '&onPulling'
40
40
} ) ;
41
41
42
+ function handleMousedown ( e ) {
43
+ e . touches = e . touches || [ {
44
+ screenX : e . screenX ,
45
+ screenY : e . screenY
46
+ } ] ;
47
+ // Mouse needs this
48
+ startY = parseInt ( e . touches [ 0 ] . screenY , 10 ) ;
49
+ }
50
+
42
51
function handleTouchend ( ) {
43
52
// if this wasn't an overscroll, get out immediately
44
53
if ( ! canOverscroll && ! isDragging ) {
@@ -69,6 +78,11 @@ IonicModule
69
78
}
70
79
71
80
function handleTouchmove ( e ) {
81
+ e . touches = e . touches || [ {
82
+ screenX : e . screenX ,
83
+ screenY : e . screenY
84
+ } ] ;
85
+
72
86
// if multitouch or regular scroll event, get out immediately
73
87
if ( ! canOverscroll || e . touches . length > 1 ) {
74
88
return ;
@@ -249,6 +263,9 @@ IonicModule
249
263
250
264
ionic . on ( 'touchmove' , handleTouchmove , scrollChild ) ;
251
265
ionic . on ( 'touchend' , handleTouchend , scrollChild ) ;
266
+ ionic . on ( 'mousedown' , handleMousedown , scrollChild ) ;
267
+ ionic . on ( 'mousemove' , handleTouchmove , scrollChild ) ;
268
+ ionic . on ( 'mouseup' , handleTouchend , scrollChild ) ;
252
269
ionic . on ( 'scroll' , handleScroll , scrollParent ) ;
253
270
254
271
// cleanup when done
@@ -258,6 +275,9 @@ IonicModule
258
275
function destroy ( ) {
259
276
ionic . off ( 'touchmove' , handleTouchmove , scrollChild ) ;
260
277
ionic . off ( 'touchend' , handleTouchend , scrollChild ) ;
278
+ ionic . off ( 'mousedown' , handleMousedown , scrollChild ) ;
279
+ ionic . off ( 'mousemove' , handleTouchmove , scrollChild ) ;
280
+ ionic . off ( 'mouseup' , handleTouchend , scrollChild ) ;
261
281
ionic . off ( 'scroll' , handleScroll , scrollParent ) ;
262
282
scrollParent = null ;
263
283
scrollChild = null ;
0 commit comments