|
@ -3,7 +3,7 @@
|
3
|
3
|
*
|
4
|
4
|
* Copyright (c) 2014 Jorik Tangelder;
|
5
|
5
|
* Licensed under the MIT license */
|
6
|
|
(function(window, document, exportName, undefined) {
|
|
6
|
(function(window, document, exportName, undefinedVar) {
|
7
|
7
|
'use strict';
|
8
|
8
|
|
9
|
9
|
var VENDOR_PREFIXES = ['', 'webkit', 'moz', 'MS', 'ms', 'o'];
|
|
@ -58,7 +58,7 @@ function each(obj, iterator, context) {
|
58
|
58
|
|
59
|
59
|
if (obj.forEach) {
|
60
|
60
|
obj.forEach(iterator, context);
|
61
|
|
} else if (obj.length !== undefined) {
|
|
61
|
} else if (obj.length !== undefinedVar) {
|
62
|
62
|
i = 0;
|
63
|
63
|
while (i < obj.length) {
|
64
|
64
|
iterator.call(context, obj[i], i, obj);
|
|
@ -83,7 +83,7 @@ function extend(dest, src, merge) {
|
83
|
83
|
var keys = Object.keys(src);
|
84
|
84
|
var i = 0;
|
85
|
85
|
while (i < keys.length) {
|
86
|
|
if (!merge || (merge && dest[keys[i]] === undefined)) {
|
|
86
|
if (!merge || (merge && dest[keys[i]] === undefinedVar)) {
|
87
|
87
|
dest[keys[i]] = src[keys[i]];
|
88
|
88
|
}
|
89
|
89
|
i++;
|
|
@ -142,7 +142,7 @@ function bindFn(fn, context) {
|
142
|
142
|
*/
|
143
|
143
|
function boolOrFn(val, args) {
|
144
|
144
|
if (typeof val == TYPE_FUNCTION) {
|
145
|
|
return val.apply(args ? args[0] || undefined : undefined, args);
|
|
145
|
return val.apply(args ? args[0] || undefinedVar : undefinedVar, args);
|
146
|
146
|
}
|
147
|
147
|
return val;
|
148
|
148
|
}
|
|
@ -154,7 +154,7 @@ function boolOrFn(val, args) {
|
154
|
154
|
* @returns {*}
|
155
|
155
|
*/
|
156
|
156
|
function ifUndefined(val1, val2) {
|
157
|
|
return (val1 === undefined) ? val2 : val1;
|
|
157
|
return (val1 === undefinedVar) ? val2 : val1;
|
158
|
158
|
}
|
159
|
159
|
|
160
|
160
|
/**
|
|
@ -302,7 +302,7 @@ function prefixed(obj, property) {
|
302
|
302
|
}
|
303
|
303
|
i++;
|
304
|
304
|
}
|
305
|
|
return undefined;
|
|
305
|
return undefinedVar;
|
306
|
306
|
}
|
307
|
307
|
|
308
|
308
|
/**
|
|
@ -327,7 +327,7 @@ function getWindowForElement(element) {
|
327
|
327
|
var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
|
328
|
328
|
|
329
|
329
|
var SUPPORT_TOUCH = ('ontouchstart' in window);
|
330
|
|
var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefined;
|
|
330
|
var SUPPORT_POINTER_EVENTS = prefixed(window, 'PointerEvent') !== undefinedVar;
|
331
|
331
|
var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
|
332
|
332
|
|
333
|
333
|
var INPUT_TYPE_TOUCH = 'touch';
|
|
@ -545,7 +545,7 @@ function computeIntervalInputData(session, input) {
|
545
|
545
|
deltaTime = input.timeStamp - last.timeStamp,
|
546
|
546
|
velocity, velocityX, velocityY, direction;
|
547
|
547
|
|
548
|
|
if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
|
|
548
|
if (input.eventType != INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefinedVar)) {
|
549
|
549
|
var deltaX = last.deltaX - input.deltaX;
|
550
|
550
|
var deltaY = last.deltaY - input.deltaY;
|
551
|
551
|
|
|
@ -1081,7 +1081,7 @@ inherit(TouchMouseInput, Input, {
|
1081
|
1081
|
});
|
1082
|
1082
|
|
1083
|
1083
|
var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
|
1084
|
|
var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
|
|
1084
|
var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefinedVar;
|
1085
|
1085
|
|
1086
|
1086
|
// magical touchAction value
|
1087
|
1087
|
var TOUCH_ACTION_COMPUTE = 'compute';
|