1
- /*! Hammer.JS - v2.0.8 - 2016-09-30
1
+ /*! Hammer.JS - v2.0.8 - 2017-07-24
2
2
* http://hammerjs.github.io/
3
3
*
4
4
* Copyright (c) Jorik Tangelder;
@@ -237,118 +237,15 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
237
237
return obj && typeof Symbol === "function" && obj . constructor === Symbol && obj !== Symbol . prototype ? "symbol" : typeof obj ;
238
238
} ;
239
239
240
- var asyncGenerator = function ( ) {
241
- function AwaitValue ( value ) {
242
- this . value = value ;
243
- }
244
-
245
- function AsyncGenerator ( gen ) {
246
- var front , back ;
247
-
248
- function send ( key , arg ) {
249
- return new Promise ( function ( resolve , reject ) {
250
- var request = {
251
- key : key ,
252
- arg : arg ,
253
- resolve : resolve ,
254
- reject : reject ,
255
- next : null
256
- } ;
257
-
258
- if ( back ) {
259
- back = back . next = request ;
260
- } else {
261
- front = back = request ;
262
- resume ( key , arg ) ;
263
- }
264
- } ) ;
265
- }
266
-
267
- function resume ( key , arg ) {
268
- try {
269
- var result = gen [ key ] ( arg ) ;
270
- var value = result . value ;
271
-
272
- if ( value instanceof AwaitValue ) {
273
- Promise . resolve ( value . value ) . then ( function ( arg ) {
274
- resume ( "next" , arg ) ;
275
- } , function ( arg ) {
276
- resume ( "throw" , arg ) ;
277
- } ) ;
278
- } else {
279
- settle ( result . done ? "return" : "normal" , result . value ) ;
280
- }
281
- } catch ( err ) {
282
- settle ( "throw" , err ) ;
283
- }
284
- }
285
-
286
- function settle ( type , value ) {
287
- switch ( type ) {
288
- case "return" :
289
- front . resolve ( {
290
- value : value ,
291
- done : true
292
- } ) ;
293
- break ;
294
-
295
- case "throw" :
296
- front . reject ( value ) ;
297
- break ;
298
-
299
- default :
300
- front . resolve ( {
301
- value : value ,
302
- done : false
303
- } ) ;
304
- break ;
305
- }
306
240
307
- front = front . next ;
308
241
309
- if ( front ) {
310
- resume ( front . key , front . arg ) ;
311
- } else {
312
- back = null ;
313
- }
314
- }
315
242
316
- this . _invoke = send ;
317
243
318
- if ( typeof gen . return !== "function" ) {
319
- this . return = undefined ;
320
- }
321
- }
322
244
323
- if ( typeof Symbol === "function" && Symbol . asyncIterator ) {
324
- AsyncGenerator . prototype [ Symbol . asyncIterator ] = function ( ) {
325
- return this ;
326
- } ;
327
- }
328
245
329
- AsyncGenerator . prototype . next = function ( arg ) {
330
- return this . _invoke ( "next" , arg ) ;
331
- } ;
332
246
333
- AsyncGenerator . prototype . throw = function ( arg ) {
334
- return this . _invoke ( "throw" , arg ) ;
335
- } ;
336
247
337
- AsyncGenerator . prototype . return = function ( arg ) {
338
- return this . _invoke ( "return" , arg ) ;
339
- } ;
340
248
341
- return {
342
- wrap : function ( fn ) {
343
- return function ( ) {
344
- return new AsyncGenerator ( fn . apply ( this , arguments ) ) ;
345
- } ;
346
- } ,
347
- await : function ( value ) {
348
- return new AwaitValue ( value ) ;
349
- }
350
- } ;
351
- } ( ) ;
352
249
353
250
var classCallCheck = function ( instance , Constructor ) {
354
251
if ( ! ( instance instanceof Constructor ) ) {
@@ -374,7 +271,13 @@ var createClass = function () {
374
271
} ;
375
272
} ( ) ;
376
273
377
- var get = function get ( object , property , receiver ) {
274
+
275
+
276
+
277
+
278
+
279
+
280
+ var get$1 = function get$1 ( object , property , receiver ) {
378
281
if ( object === null ) object = Function . prototype ;
379
282
var desc = Object . getOwnPropertyDescriptor ( object , property ) ;
380
283
@@ -384,7 +287,7 @@ var get = function get(object, property, receiver) {
384
287
if ( parent === null ) {
385
288
return undefined ;
386
289
} else {
387
- return get ( parent , property , receiver ) ;
290
+ return get$1 ( parent , property , receiver ) ;
388
291
}
389
292
} else if ( "value" in desc ) {
390
293
return desc . value ;
@@ -415,6 +318,16 @@ var inherits = function (subClass, superClass) {
415
318
if ( superClass ) Object . setPrototypeOf ? Object . setPrototypeOf ( subClass , superClass ) : subClass . __proto__ = superClass ;
416
319
} ;
417
320
321
+
322
+
323
+
324
+
325
+
326
+
327
+
328
+
329
+
330
+
418
331
var possibleConstructorReturn = function ( self , call ) {
419
332
if ( ! self ) {
420
333
throw new ReferenceError ( "this hasn't been initialised - super() hasn't been called" ) ;
@@ -423,6 +336,30 @@ var possibleConstructorReturn = function (self, call) {
423
336
return call && ( typeof call === "object" || typeof call === "function" ) ? call : self ;
424
337
} ;
425
338
339
+
340
+
341
+ var set$1 = function set$1 ( object , property , value , receiver ) {
342
+ var desc = Object . getOwnPropertyDescriptor ( object , property ) ;
343
+
344
+ if ( desc === undefined ) {
345
+ var parent = Object . getPrototypeOf ( object ) ;
346
+
347
+ if ( parent !== null ) {
348
+ set$1 ( parent , property , value , receiver ) ;
349
+ }
350
+ } else if ( "value" in desc && desc . writable ) {
351
+ desc . value = value ;
352
+ } else {
353
+ var setter = desc . set ;
354
+
355
+ if ( setter !== undefined ) {
356
+ setter . call ( receiver , value ) ;
357
+ }
358
+ }
359
+
360
+ return value ;
361
+ } ;
362
+
426
363
var slicedToArray = function ( ) {
427
364
function sliceIterator ( arr , i ) {
428
365
var _arr = [ ] ;
@@ -947,7 +884,7 @@ var RotateRecognizer = function (_AttrRecognizer) {
947
884
} , {
948
885
key : 'attrTest' ,
949
886
value : function attrTest ( input ) {
950
- return get ( RotateRecognizer . prototype . __proto__ || Object . getPrototypeOf ( RotateRecognizer . prototype ) , 'attrTest' , this ) . call ( this , input ) && ( Math . abs ( input . rotation ) > this . options . threshold || this . state & STATE_BEGAN ) ;
887
+ return get$1 ( RotateRecognizer . prototype . __proto__ || Object . getPrototypeOf ( RotateRecognizer . prototype ) , 'attrTest' , this ) . call ( this , input ) && ( Math . abs ( input . rotation ) > this . options . threshold || this . state & STATE_BEGAN ) ;
951
888
}
952
889
} ] ) ;
953
890
return RotateRecognizer ;
@@ -983,7 +920,7 @@ var PinchRecognizer = function (_AttrRecognizer) {
983
920
} , {
984
921
key : 'attrTest' ,
985
922
value : function attrTest ( input ) {
986
- return get ( PinchRecognizer . prototype . __proto__ || Object . getPrototypeOf ( PinchRecognizer . prototype ) , 'attrTest' , this ) . call ( this , input ) && ( Math . abs ( input . scale - 1 ) > this . options . threshold || this . state & STATE_BEGAN ) ;
923
+ return get$1 ( PinchRecognizer . prototype . __proto__ || Object . getPrototypeOf ( PinchRecognizer . prototype ) , 'attrTest' , this ) . call ( this , input ) && ( Math . abs ( input . scale - 1 ) > this . options . threshold || this . state & STATE_BEGAN ) ;
987
924
}
988
925
} , {
989
926
key : 'emit' ,
@@ -992,7 +929,7 @@ var PinchRecognizer = function (_AttrRecognizer) {
992
929
var inOut = input . scale < 1 ? 'in' : 'out' ;
993
930
input . additionalEvent = this . options . event + inOut ;
994
931
}
995
- get ( PinchRecognizer . prototype . __proto__ || Object . getPrototypeOf ( PinchRecognizer . prototype ) , 'emit' , this ) . call ( this , input ) ;
932
+ get$1 ( PinchRecognizer . prototype . __proto__ || Object . getPrototypeOf ( PinchRecognizer . prototype ) , 'emit' , this ) . call ( this , input ) ;
996
933
}
997
934
} ] ) ;
998
935
return PinchRecognizer ;
@@ -1103,7 +1040,7 @@ var PanRecognizer = function (_AttrRecognizer) {
1103
1040
if ( direction ) {
1104
1041
input . additionalEvent = this . options . event + direction ;
1105
1042
}
1106
- get ( PanRecognizer . prototype . __proto__ || Object . getPrototypeOf ( PanRecognizer . prototype ) , 'emit' , this ) . call ( this , input ) ;
1043
+ get$1 ( PanRecognizer . prototype . __proto__ || Object . getPrototypeOf ( PanRecognizer . prototype ) , 'emit' , this ) . call ( this , input ) ;
1107
1044
}
1108
1045
} ] ) ;
1109
1046
return PanRecognizer ;
@@ -1152,7 +1089,7 @@ var SwipeRecognizer = function (_AttrRecognizer) {
1152
1089
velocity = input . overallVelocityY ;
1153
1090
}
1154
1091
1155
- return get ( SwipeRecognizer . prototype . __proto__ || Object . getPrototypeOf ( SwipeRecognizer . prototype ) , 'attrTest' , this ) . call ( this , input ) && direction & input . offsetDirection && input . distance > this . options . threshold && input . maxPointers === this . options . pointers && abs ( velocity ) > this . options . velocity && input . eventType & INPUT_END ;
1092
+ return get$1 ( SwipeRecognizer . prototype . __proto__ || Object . getPrototypeOf ( SwipeRecognizer . prototype ) , 'attrTest' , this ) . call ( this , input ) && direction & input . offsetDirection && input . distance > this . options . threshold && input . maxPointers === this . options . pointers && abs ( velocity ) > this . options . velocity && input . eventType & INPUT_END ;
1156
1093
}
1157
1094
} , {
1158
1095
key : 'emit' ,
@@ -1783,7 +1720,7 @@ function getScale(start, end) {
1783
1720
* @return {Number } rotation
1784
1721
*/
1785
1722
function getRotation ( start , end ) {
1786
- return getAngle ( end [ 1 ] , end [ 0 ] , PROPS_CLIENT_XY ) + getAngle ( start [ 1 ] , start [ 0 ] , PROPS_CLIENT_XY ) ;
1723
+ return getAngle ( end [ 1 ] , end [ 0 ] , PROPS_CLIENT_XY ) - getAngle ( start [ 1 ] , start [ 0 ] , PROPS_CLIENT_XY ) ;
1787
1724
}
1788
1725
1789
1726
/**
@@ -1849,8 +1786,8 @@ function computeInputData(manager, input) {
1849
1786
session . firstMultiple = false ;
1850
1787
}
1851
1788
1852
- var firstInput = session . firstInput ;
1853
- var firstMultiple = session . firstMultiple ;
1789
+ var firstInput = session . firstInput ,
1790
+ firstMultiple = session . firstMultiple ;
1854
1791
1855
1792
var offsetCenter = firstMultiple ? firstMultiple . center : firstInput . center ;
1856
1793
@@ -2448,25 +2385,20 @@ function recordTouches(eventType, eventData) {
2448
2385
}
2449
2386
2450
2387
function setLastTouch ( eventData ) {
2451
- var _this2 = this ;
2452
-
2453
- var _eventData$changedPoi = slicedToArray ( eventData . changedPointers , 1 ) ;
2454
-
2455
- var touch = _eventData$changedPoi [ 0 ] ;
2388
+ var _eventData$changedPoi = slicedToArray ( eventData . changedPointers , 1 ) ,
2389
+ touch = _eventData$changedPoi [ 0 ] ;
2456
2390
2457
2391
if ( touch . identifier === this . primaryTouch ) {
2458
- ( function ( ) {
2459
- var lastTouch = { x : touch . clientX , y : touch . clientY } ;
2460
- _this2 . lastTouches . push ( lastTouch ) ;
2461
- var lts = _this2 . lastTouches ;
2462
- var removeLastTouch = function removeLastTouch ( ) {
2463
- var i = lts . indexOf ( lastTouch ) ;
2464
- if ( i > - 1 ) {
2465
- lts . splice ( i , 1 ) ;
2466
- }
2467
- } ;
2468
- setTimeout ( removeLastTouch , DEDUP_TIMEOUT ) ;
2469
- } ) ( ) ;
2392
+ var lastTouch = { x : touch . clientX , y : touch . clientY } ;
2393
+ this . lastTouches . push ( lastTouch ) ;
2394
+ var lts = this . lastTouches ;
2395
+ var removeLastTouch = function removeLastTouch ( ) {
2396
+ var i = lts . indexOf ( lastTouch ) ;
2397
+ if ( i > - 1 ) {
2398
+ lts . splice ( i , 1 ) ;
2399
+ }
2400
+ } ;
2401
+ setTimeout ( removeLastTouch , DEDUP_TIMEOUT ) ;
2470
2402
}
2471
2403
}
2472
2404
@@ -3226,6 +3158,9 @@ assign$1(Hammer, {
3226
3158
removeEventListeners : removeEventListeners
3227
3159
} ) ;
3228
3160
3161
+ var freeGlobal = typeof window !== 'undefined' ? window : typeof self !== 'undefined' ? self : { } ; // jshint ignore:line
3162
+ freeGlobal . Hammer = Hammer ;
3163
+
3229
3164
/* jshint ignore:start */
3230
3165
if ( typeof define === 'function' && define . amd ) {
3231
3166
define ( function ( ) {
@@ -3237,4 +3172,4 @@ if (typeof define === 'function' && define.amd) {
3237
3172
window [ exportName ] = Hammer ;
3238
3173
}
3239
3174
/* jshint ignore:end */
3240
- } ) ( window , document , 'Hammer' ) ;
3175
+ } ) ( window , document , 'Hammer' ) ;
0 commit comments