handleEvent.js
1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
handleEvent: function (e) {
switch ( e.type ) {
case 'touchstart':
case 'pointerdown':
case 'MSPointerDown':
case 'mousedown':
this._start(e);
if ( this.options.zoom && e.touches && e.touches.length > 1 ) {
this._zoomStart(e);
}
break;
case 'touchmove':
case 'pointermove':
case 'MSPointerMove':
case 'mousemove':
if ( this.options.zoom && e.touches && e.touches[1] ) {
this._zoom(e);
return;
}
this._move(e);
break;
case 'touchend':
case 'pointerup':
case 'MSPointerUp':
case 'mouseup':
case 'touchcancel':
case 'pointercancel':
case 'MSPointerCancel':
case 'mousecancel':
if ( this.scaled ) {
this._zoomEnd(e);
return;
}
this._end(e);
break;
case 'orientationchange':
case 'resize':
this._resize();
break;
case 'transitionend':
case 'webkitTransitionEnd':
case 'oTransitionEnd':
case 'MSTransitionEnd':
this._transitionEnd(e);
break;
case 'wheel':
case 'DOMMouseScroll':
case 'mousewheel':
if ( this.options.wheelAction == 'zoom' ) {
this._wheelZoom(e);
return;
}
this._wheel(e);
break;
case 'keydown':
this._key(e);
break;
}
}
};