Elffuss BraidHub

kikocis/iscroll public

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