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