greensock-rails 1.16.0.0 → 1.16.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/greensock/rails/version.rb +1 -1
- data/vendor/assets/javascripts/greensock/TimelineLite.js +9 -7
- data/vendor/assets/javascripts/greensock/TimelineMax.js +11 -8
- data/vendor/assets/javascripts/greensock/TweenLite.js +5 -4
- data/vendor/assets/javascripts/greensock/TweenMax.js +107 -92
- data/vendor/assets/javascripts/greensock/jquery.gsap.js +4 -4
- data/vendor/assets/javascripts/greensock/plugins/CSSPlugin.js +92 -81
- data/vendor/assets/javascripts/greensock/utils/Draggable.js +92 -58
- metadata +3 -3
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
|
-
* VERSION: 0.1.
|
3
|
-
* DATE: 2015-
|
2
|
+
* VERSION: 0.1.11
|
3
|
+
* DATE: 2015-03-13
|
4
4
|
* UPDATES AND DOCS AT: http://greensock.com/jquery-gsap-plugin/
|
5
5
|
*
|
6
6
|
* Requires TweenLite version 1.8.0 or higher and CSSPlugin.
|
@@ -93,7 +93,7 @@
|
|
93
93
|
specEasing[p] = val[1];
|
94
94
|
val = val[0];
|
95
95
|
}
|
96
|
-
if (_legacyProps.indexOf(p) !== -1 && _legacyProps.indexOf("," + p + ",") !== -1) {
|
96
|
+
if (val === "show" || val === "hide" || val === "toggle" || (_legacyProps.indexOf(p) !== -1 && _legacyProps.indexOf("," + p + ",") !== -1)) { //note: slideUp() and slideDown() pass in opacity:"show" or opacity:"hide"
|
97
97
|
return _animate.call(this, prop, speed, easing, callback);
|
98
98
|
} else {
|
99
99
|
vars[(p.indexOf("-") === -1) ? p : $.camelCase(p)] = val;
|
@@ -176,7 +176,7 @@
|
|
176
176
|
enabled:function(value) {
|
177
177
|
_enabled = value;
|
178
178
|
},
|
179
|
-
version:"0.1.
|
179
|
+
version:"0.1.11",
|
180
180
|
legacyProps:function(value) {
|
181
181
|
_legacyProps = _defaultLegacyProps + value + ",";
|
182
182
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*!
|
2
|
-
* VERSION: 1.16.
|
3
|
-
* DATE: 2015-03-
|
2
|
+
* VERSION: 1.16.1
|
3
|
+
* DATE: 2015-03-13
|
4
4
|
* UPDATES AND DOCS AT: http://www.greensock.com
|
5
5
|
*
|
6
6
|
* @license Copyright (c) 2008-2015, GreenSock. All rights reserved.
|
@@ -31,7 +31,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
31
31
|
p = CSSPlugin.prototype = new TweenPlugin("css");
|
32
32
|
|
33
33
|
p.constructor = CSSPlugin;
|
34
|
-
CSSPlugin.version = "1.16.
|
34
|
+
CSSPlugin.version = "1.16.1";
|
35
35
|
CSSPlugin.API = 2;
|
36
36
|
CSSPlugin.defaultTransformPerspective = 0;
|
37
37
|
CSSPlugin.defaultSkewType = "compensated";
|
@@ -313,6 +313,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
313
313
|
if (x === "center" || (isNaN(parseFloat(x)) && (x + "").indexOf("=") === -1)) { //remember, the user could flip-flop the values and say "bottom center" or "center bottom", etc. "center" is ambiguous because it could be used to describe horizontal or vertical, hence the isNaN(). If there's an "=" sign in the value, it's relative.
|
314
314
|
x = "50%";
|
315
315
|
}
|
316
|
+
v = x + " " + y + ((a.length > 2) ? " " + a[2] : "");
|
316
317
|
if (recObj) {
|
317
318
|
recObj.oxp = (x.indexOf("%") !== -1);
|
318
319
|
recObj.oyp = (y.indexOf("%") !== -1);
|
@@ -320,8 +321,9 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
320
321
|
recObj.oyr = (y.charAt(1) === "=");
|
321
322
|
recObj.ox = parseFloat(x.replace(_NaNExp, ""));
|
322
323
|
recObj.oy = parseFloat(y.replace(_NaNExp, ""));
|
324
|
+
recObj.v = v;
|
323
325
|
}
|
324
|
-
return
|
326
|
+
return recObj || v;
|
325
327
|
},
|
326
328
|
|
327
329
|
/**
|
@@ -1385,26 +1387,73 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1385
1387
|
},
|
1386
1388
|
*/
|
1387
1389
|
|
1388
|
-
|
1390
|
+
_setTransformRatio = _internals.set3DTransformRatio = _internals.setTransformRatio = function(v) {
|
1389
1391
|
var t = this.data, //refers to the element's _gsTransform object
|
1390
1392
|
style = this.t.style,
|
1391
|
-
angle = t.rotation
|
1393
|
+
angle = t.rotation,
|
1394
|
+
rotationX = t.rotationX,
|
1395
|
+
rotationY = t.rotationY,
|
1392
1396
|
sx = t.scaleX,
|
1393
1397
|
sy = t.scaleY,
|
1394
1398
|
sz = t.scaleZ,
|
1395
1399
|
x = t.x,
|
1396
1400
|
y = t.y,
|
1397
1401
|
z = t.z,
|
1402
|
+
isSVG = t.svg,
|
1398
1403
|
perspective = t.perspective,
|
1404
|
+
force3D = t.force3D,
|
1399
1405
|
a11, a12, a13, a21, a22, a23, a31, a32, a33, a41, a42, a43,
|
1400
|
-
zOrigin, min, cos, sin, t1, t2, transform, comma, zero;
|
1401
|
-
|
1402
|
-
|
1406
|
+
zOrigin, min, cos, sin, t1, t2, transform, comma, zero, skew, rnd;
|
1407
|
+
|
1408
|
+
//check to see if we should render as 2D (and SVGs must use 2D when _useSVGTransformAttr is true)
|
1409
|
+
if (((((v === 1 || v === 0) && force3D === "auto" && (this.tween._totalTime === this.tween._totalDuration || !this.tween._totalTime)) || !force3D) && !z && !perspective && !rotationY && !rotationX) || (_useSVGTransformAttr && isSVG) || !_supports3D) { //on the final render (which could be 0 for a from tween), if there are no 3D aspects, render in 2D to free up memory and improve performance especially on mobile devices. Check the tween's totalTime/totalDuration too in order to make sure it doesn't happen between repeats if it's a repeating tween.
|
1410
|
+
|
1411
|
+
//2D
|
1412
|
+
if (angle || t.skewX || isSVG) {
|
1413
|
+
angle *= _DEG2RAD;
|
1414
|
+
skew = t.skewX * _DEG2RAD;
|
1415
|
+
rnd = 100000;
|
1416
|
+
a11 = Math.cos(angle) * sx;
|
1417
|
+
a21 = Math.sin(angle) * sx;
|
1418
|
+
a12 = Math.sin(angle - skew) * -sy;
|
1419
|
+
a22 = Math.cos(angle - skew) * sy;
|
1420
|
+
if (skew && t.skewType === "simple") { //by default, we compensate skewing on the other axis to make it look more natural, but you can set the skewType to "simple" to use the uncompensated skewing that CSS does
|
1421
|
+
t1 = Math.tan(skew);
|
1422
|
+
t1 = Math.sqrt(1 + t1 * t1);
|
1423
|
+
a12 *= t1;
|
1424
|
+
a22 *= t1;
|
1425
|
+
if (t.skewY) {
|
1426
|
+
a11 *= t1;
|
1427
|
+
a21 *= t1;
|
1428
|
+
}
|
1429
|
+
}
|
1430
|
+
if (isSVG) {
|
1431
|
+
x += t.xOrigin - (t.xOrigin * a11 + t.yOrigin * a12);
|
1432
|
+
y += t.yOrigin - (t.xOrigin * a21 + t.yOrigin * a22);
|
1433
|
+
min = 0.000001;
|
1434
|
+
if (x < min) if (x > -min) {
|
1435
|
+
x = 0;
|
1436
|
+
}
|
1437
|
+
if (y < min) if (y > -min) {
|
1438
|
+
y = 0;
|
1439
|
+
}
|
1440
|
+
}
|
1441
|
+
transform = (((a11 * rnd) | 0) / rnd) + "," + (((a21 * rnd) | 0) / rnd) + "," + (((a12 * rnd) | 0) / rnd) + "," + (((a22 * rnd) | 0) / rnd) + "," + x + "," + y + ")";
|
1442
|
+
if (isSVG && _useSVGTransformAttr) {
|
1443
|
+
this.t.setAttribute("transform", "matrix(" + transform);
|
1444
|
+
} else {
|
1445
|
+
//some browsers have a hard time with very small values like 2.4492935982947064e-16 (notice the "e-" towards the end) and would render the object slightly off. So we round to 5 decimal places.
|
1446
|
+
style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix(" : "matrix(") + transform;
|
1447
|
+
}
|
1448
|
+
} else {
|
1449
|
+
style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix(" : "matrix(") + sx + ",0,0," + sy + "," + x + "," + y + ")";
|
1450
|
+
}
|
1403
1451
|
return;
|
1452
|
+
|
1404
1453
|
}
|
1405
|
-
if (_isFirefox) {
|
1454
|
+
if (_isFirefox) { //Firefox has a bug (at least in v25) that causes it to render the transparent part of 32-bit PNG images as black when displayed inside an iframe and the 3D scale is very small and doesn't change sufficiently enough between renders (like if you use a Power4.easeInOut to scale from 0 to 1 where the beginning values only change a tiny amount to begin the tween before accelerating). In this case, we force the scale to be 0.00002 instead which is visually the same but works around the Firefox issue.
|
1406
1455
|
min = 0.0001;
|
1407
|
-
if (sx < min && sx > -min) {
|
1456
|
+
if (sx < min && sx > -min) {
|
1408
1457
|
sx = sz = 0.00002;
|
1409
1458
|
}
|
1410
1459
|
if (sy < min && sy > -min) {
|
@@ -1415,6 +1464,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1415
1464
|
}
|
1416
1465
|
}
|
1417
1466
|
if (angle || t.skewX) {
|
1467
|
+
angle *= _DEG2RAD;
|
1418
1468
|
cos = a11 = Math.cos(angle);
|
1419
1469
|
sin = a21 = Math.sin(angle);
|
1420
1470
|
if (t.skewX) {
|
@@ -1426,12 +1476,16 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1426
1476
|
t1 = Math.sqrt(1 + t1 * t1);
|
1427
1477
|
cos *= t1;
|
1428
1478
|
sin *= t1;
|
1479
|
+
if (t.skewY) {
|
1480
|
+
a11 *= t1;
|
1481
|
+
a21 *= t1;
|
1482
|
+
}
|
1429
1483
|
}
|
1430
1484
|
}
|
1431
1485
|
a12 = -sin;
|
1432
1486
|
a22 = cos;
|
1433
1487
|
|
1434
|
-
} else if (!
|
1488
|
+
} else if (!rotationY && !rotationX && sz === 1 && !perspective && !isSVG) { //if we're only translating and/or 2D scaling, this is faster...
|
1435
1489
|
style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) translate3d(" : "translate3d(") + x + "px," + y + "px," + z +"px)" + ((sx !== 1 || sy !== 1) ? " scale(" + sx + "," + sy + ")" : "");
|
1436
1490
|
return;
|
1437
1491
|
} else {
|
@@ -1465,7 +1519,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1465
1519
|
min = 0.000001; //threshold below which browsers use scientific notation which won't work.
|
1466
1520
|
comma = ",";
|
1467
1521
|
zero = "0";
|
1468
|
-
angle =
|
1522
|
+
angle = rotationY * _DEG2RAD;
|
1469
1523
|
if (angle) {
|
1470
1524
|
cos = Math.cos(angle);
|
1471
1525
|
sin = Math.sin(angle);
|
@@ -1478,7 +1532,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1478
1532
|
a11 *= cos;
|
1479
1533
|
a21 *= cos;
|
1480
1534
|
}
|
1481
|
-
angle =
|
1535
|
+
angle = rotationX * _DEG2RAD;
|
1482
1536
|
if (angle) {
|
1483
1537
|
cos = Math.cos(angle);
|
1484
1538
|
sin = Math.sin(angle);
|
@@ -1512,13 +1566,13 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1512
1566
|
a41*=sx;
|
1513
1567
|
}
|
1514
1568
|
|
1515
|
-
if (zOrigin ||
|
1569
|
+
if (zOrigin || isSVG) {
|
1516
1570
|
if (zOrigin) {
|
1517
1571
|
x += a13*-zOrigin;
|
1518
1572
|
y += a23*-zOrigin;
|
1519
1573
|
z += a33*-zOrigin+zOrigin;
|
1520
1574
|
}
|
1521
|
-
if (
|
1575
|
+
if (isSVG) { //due to bugs in some browsers, we need to manage the transform-origin of SVG manually
|
1522
1576
|
x += t.xOrigin - (t.xOrigin * a11 + t.yOrigin * a12);
|
1523
1577
|
y += t.yOrigin - (t.xOrigin * a21 + t.yOrigin * a22);
|
1524
1578
|
}
|
@@ -1537,7 +1591,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1537
1591
|
transform = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix3d(" : "matrix3d(");
|
1538
1592
|
transform += ((a11 < min && a11 > -min) ? zero : a11) + comma + ((a21 < min && a21 > -min) ? zero : a21) + comma + ((a31 < min && a31 > -min) ? zero : a31);
|
1539
1593
|
transform += comma + ((a41 < min && a41 > -min) ? zero : a41) + comma + ((a12 < min && a12 > -min) ? zero : a12) + comma + ((a22 < min && a22 > -min) ? zero : a22);
|
1540
|
-
if (
|
1594
|
+
if (rotationX || rotationY) { //performance optimization (often there's no rotationX or rotationY, so we can skip these calculations)
|
1541
1595
|
transform += comma + ((a32 < min && a32 > -min) ? zero : a32) + comma + ((a42 < min && a42 > -min) ? zero : a42) + comma + ((a13 < min && a13 > -min) ? zero : a13);
|
1542
1596
|
transform += comma + ((a23 < min && a23 > -min) ? zero : a23) + comma + ((a33 < min && a33 > -min) ? zero : a33) + comma + ((a43 < min && a43 > -min) ? zero : a43) + comma;
|
1543
1597
|
} else {
|
@@ -1546,57 +1600,6 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1546
1600
|
transform += x + comma + y + comma + z + comma + (perspective ? (1 + (-z / perspective)) : 1) + ")";
|
1547
1601
|
|
1548
1602
|
style[_transformProp] = transform;
|
1549
|
-
},
|
1550
|
-
|
1551
|
-
_set2DTransformRatio = _internals.set2DTransformRatio = function(v) {
|
1552
|
-
var t = this.data, //refers to the element's _gsTransform object
|
1553
|
-
targ = this.t,
|
1554
|
-
style = targ.style,
|
1555
|
-
x = t.x,
|
1556
|
-
y = t.y,
|
1557
|
-
ang, skew, rnd, sx, sy, a, b, c, d, matrix, min, t1;
|
1558
|
-
if ((t.rotationX || t.rotationY || t.z || t.force3D === true || (t.force3D === "auto" && v !== 1 && v !== 0)) && !(t.svg && _useSVGTransformAttr) && _supports3D) { //if a 3D tween begins while a 2D one is running, we need to kick the rendering over to the 3D method. For example, imagine a yoyo-ing, infinitely repeating scale tween running, and then the object gets rotated in 3D space with a different tween.
|
1559
|
-
this.setRatio = _set3DTransformRatio;
|
1560
|
-
_set3DTransformRatio.call(this, v);
|
1561
|
-
return;
|
1562
|
-
}
|
1563
|
-
sx = t.scaleX;
|
1564
|
-
sy = t.scaleY;
|
1565
|
-
if (t.rotation || t.skewX || t.svg) {
|
1566
|
-
ang = t.rotation * _DEG2RAD;
|
1567
|
-
skew = t.skewX * _DEG2RAD;
|
1568
|
-
rnd = 100000;
|
1569
|
-
a = Math.cos(ang) * sx;
|
1570
|
-
b = Math.sin(ang) * sx;
|
1571
|
-
c = Math.sin(ang - skew) * -sy;
|
1572
|
-
d = Math.cos(ang - skew) * sy;
|
1573
|
-
if (skew && t.skewType === "simple") { //by default, we compensate skewing on the other axis to make it look more natural, but you can set the skewType to "simple" to use the uncompensated skewing that CSS does
|
1574
|
-
t1 = Math.tan(skew);
|
1575
|
-
t1 = Math.sqrt(1 + t1 * t1);
|
1576
|
-
c *= t1;
|
1577
|
-
d *= t1;
|
1578
|
-
}
|
1579
|
-
if (t.svg) {
|
1580
|
-
x += t.xOrigin - (t.xOrigin * a + t.yOrigin * c);
|
1581
|
-
y += t.yOrigin - (t.xOrigin * b + t.yOrigin * d);
|
1582
|
-
min = 0.000001;
|
1583
|
-
if (x < min) if (x > -min) {
|
1584
|
-
x = 0;
|
1585
|
-
}
|
1586
|
-
if (y < min) if (y > -min) {
|
1587
|
-
y = 0;
|
1588
|
-
}
|
1589
|
-
}
|
1590
|
-
matrix = (((a * rnd) | 0) / rnd) + "," + (((b * rnd) | 0) / rnd) + "," + (((c * rnd) | 0) / rnd) + "," + (((d * rnd) | 0) / rnd) + "," + x + "," + y + ")";
|
1591
|
-
if (t.svg && _useSVGTransformAttr) {
|
1592
|
-
targ.setAttribute("transform", "matrix(" + matrix);
|
1593
|
-
} else {
|
1594
|
-
//some browsers have a hard time with very small values like 2.4492935982947064e-16 (notice the "e-" towards the end) and would render the object slightly off. So we round to 5 decimal places.
|
1595
|
-
style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix(" : "matrix(") + matrix;
|
1596
|
-
}
|
1597
|
-
} else {
|
1598
|
-
style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix(" : "matrix(") + sx + ",0,0," + sy + "," + x + "," + y + ")";
|
1599
|
-
}
|
1600
1603
|
};
|
1601
1604
|
|
1602
1605
|
p = Transform.prototype;
|
@@ -1722,7 +1725,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1722
1725
|
pt.xs0 = pt.e = orig;
|
1723
1726
|
}
|
1724
1727
|
|
1725
|
-
|
1728
|
+
//for older versions of IE (6-8), we need to manually calculate things inside the setRatio() function. We record origin x and y (ox and oy) and whether or not the values are percentages (oxp and oyp).
|
1726
1729
|
} else {
|
1727
1730
|
_parsePosition(orig + "", m1);
|
1728
1731
|
}
|
@@ -1971,14 +1974,12 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1971
1974
|
}
|
1972
1975
|
t._gsClassPT = pt;
|
1973
1976
|
pt.e = (e.charAt(1) !== "=") ? e : b.replace(new RegExp("\\s*\\b" + e.substr(2) + "\\b"), "") + ((e.charAt(0) === "+") ? " " + e.substr(2) : "");
|
1974
|
-
|
1975
|
-
|
1976
|
-
|
1977
|
-
|
1978
|
-
|
1979
|
-
|
1980
|
-
pt = pt.xfirst = cssp.parse(t, difData.difs, pt, plugin); //we record the CSSPropTween as the xfirst so that we can handle overwriting propertly (if "className" gets overwritten, we must kill all the properties associated with the className part of the tween, so we can loop through from xfirst to the pt itself)
|
1981
|
-
}
|
1977
|
+
t.setAttribute("class", pt.e);
|
1978
|
+
difData = _cssDif(t, bs, _getAllStyles(t), vars, cnptLookup);
|
1979
|
+
t.setAttribute("class", b);
|
1980
|
+
pt.data = difData.firstMPT;
|
1981
|
+
t.style.cssText = cssText; //we recorded cssText before we swapped classes and ran _getAllStyles() because in cases when a className tween is overwritten, we remove all the related tweening properties from that class change (otherwise class-specific stuff can't override properties we've directly set on the target's style object due to specificity).
|
1982
|
+
pt = pt.xfirst = cssp.parse(t, difData.difs, pt, plugin); //we record the CSSPropTween as the xfirst so that we can handle overwriting propertly (if "className" gets overwritten, we must kill all the properties associated with the className part of the tween, so we can loop through from xfirst to the pt itself)
|
1982
1983
|
return pt;
|
1983
1984
|
}});
|
1984
1985
|
|
@@ -1987,7 +1988,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1987
1988
|
if (v === 1 || v === 0) if (this.data._totalTime === this.data._totalDuration && this.data.data !== "isFromStart") { //this.data refers to the tween. Only clear at the END of the tween (remember, from() tweens make the ratio go from 1 to 0, so we can't just check that and if the tween is the zero-duration one that's created internally to render the starting values in a from() tween, ignore that because otherwise, for example, from(...{height:100, clearProps:"height", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in).
|
1988
1989
|
var s = this.t.style,
|
1989
1990
|
transformParse = _specialProps.transform.parse,
|
1990
|
-
a, p, i, clearTransform;
|
1991
|
+
a, p, i, clearTransform, transform;
|
1991
1992
|
if (this.e === "all") {
|
1992
1993
|
s.cssText = "";
|
1993
1994
|
clearTransform = true;
|
@@ -2008,7 +2009,11 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
2008
2009
|
}
|
2009
2010
|
if (clearTransform) {
|
2010
2011
|
_removeProp(s, _transformProp);
|
2011
|
-
|
2012
|
+
transform = this.t._gsTransform;
|
2013
|
+
if (transform) {
|
2014
|
+
if (transform.svg) {
|
2015
|
+
this.t.removeAttribute("data-svg-origin");
|
2016
|
+
}
|
2012
2017
|
delete this.t._gsTransform;
|
2013
2018
|
}
|
2014
2019
|
}
|
@@ -2075,7 +2080,12 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
2075
2080
|
vars = v;
|
2076
2081
|
style.cssText = first;
|
2077
2082
|
}
|
2078
|
-
|
2083
|
+
|
2084
|
+
if (vars.className) { //className tweens will combine any differences they find in the css with the vars that are passed in, so {className:"myClass", scale:0.5, left:20} would work.
|
2085
|
+
this._firstPT = pt = _specialProps.className.parse(target, vars.className, "className", this, null, null, vars);
|
2086
|
+
} else {
|
2087
|
+
this._firstPT = pt = this.parse(target, vars, null);
|
2088
|
+
}
|
2079
2089
|
|
2080
2090
|
if (this._transformType) {
|
2081
2091
|
threeD = (this._transformType === 3);
|
@@ -2105,9 +2115,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
2105
2115
|
}
|
2106
2116
|
tpt = new CSSPropTween(target, "transform", 0, 0, null, 2);
|
2107
2117
|
this._linkCSSP(tpt, null, pt2);
|
2108
|
-
tpt.setRatio =
|
2118
|
+
tpt.setRatio = _transformProp ? _setTransformRatio : _setIETransformRatio;
|
2109
2119
|
tpt.data = this._transform || _getTransform(target, _cs, true);
|
2110
2120
|
tpt.tween = tween;
|
2121
|
+
tpt.pr = -1; //ensures that the transforms get applied after the components are updated.
|
2111
2122
|
_overwriteProps.pop(); //we don't want to force the overwrite of all "transform" tweens of the target - we only care about individual transform properties like scaleX, rotation, etc. The CSSPropTween constructor automatically adds the property to _overwriteProps which is why we need to pop() here.
|
2112
2123
|
}
|
2113
2124
|
|
@@ -1,9 +1,9 @@
|
|
1
1
|
/*!
|
2
|
-
* VERSION: 0.
|
3
|
-
* DATE: 2015-03-
|
2
|
+
* VERSION: 0.13.0
|
3
|
+
* DATE: 2015-03-13
|
4
4
|
* UPDATES AND DOCS AT: http://greensock.com
|
5
5
|
*
|
6
|
-
* Requires TweenLite and CSSPlugin version 1.
|
6
|
+
* Requires TweenLite and CSSPlugin version 1.16.1 or later (TweenMax contains both TweenLite and CSSPlugin). ThrowPropsPlugin is required for momentum-based continuation of movement after the mouse/touch is released (ThrowPropsPlugin is a membership benefit of Club GreenSock - http://greensock.com/club/).
|
7
7
|
*
|
8
8
|
* @license Copyright (c) 2008-2015, GreenSock. All rights reserved.
|
9
9
|
* This work is subject to the terms at http://greensock.com/standard-license or for
|
@@ -40,8 +40,9 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
40
40
|
_dragCount = 0, //total number of elements currently being dragged
|
41
41
|
_prefix,
|
42
42
|
_isMultiTouching,
|
43
|
+
_isAndroid = (navigator.userAgent.toLowerCase().indexOf("android") !== -1), //Android handles touch events in an odd way and it's virtually impossible to "feature test" so we resort to UA sniffing
|
43
44
|
_lastDragTime = 0,
|
44
|
-
_windowProxy = {}, //memory/performance
|
45
|
+
_windowProxy = {}, //memory/performance optimization - we reuse this object during autoScroll to store window-related bounds/offsets.
|
45
46
|
_slice = function(a) { //don't use Array.prototype.slice.call(target, 0) because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll()
|
46
47
|
if (typeof(a) === "string") {
|
47
48
|
a = TweenLite.selector(a);
|
@@ -385,9 +386,9 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
385
386
|
}
|
386
387
|
if (e.getBBox && _isSVG(e)) { //SVG elements must be handled in a special way because their origins are calculated from the parent SVG canvas origin
|
387
388
|
if (!e._gsTransform) {
|
388
|
-
TweenLite.set(e, {x:"+=0"}); //forces creation of the _gsTransform where we store all the transform components including xOrigin and yOrigin for SVG elements, as of GSAP 1.15.0 which also takes care of calculating the origin from the upper left corner of the SVG canvas.
|
389
|
+
TweenLite.set(e, {x:"+=0", overwrite:false}); //forces creation of the _gsTransform where we store all the transform components including xOrigin and yOrigin for SVG elements, as of GSAP 1.15.0 which also takes care of calculating the origin from the upper left corner of the SVG canvas.
|
389
390
|
if (e._gsTransform.xOrigin === undefined) {
|
390
|
-
console.log("Draggable requires at least GSAP 1.16.
|
391
|
+
console.log("Draggable requires at least GSAP 1.16.1");
|
391
392
|
}
|
392
393
|
}
|
393
394
|
v = e.getBBox();
|
@@ -572,9 +573,9 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
572
573
|
return obj;
|
573
574
|
}("touchstart,touchmove,touchend,touchcancel")),
|
574
575
|
|
575
|
-
_addListener = function(element, type, func) {
|
576
|
+
_addListener = function(element, type, func, capture) {
|
576
577
|
if (element.addEventListener) {
|
577
|
-
element.addEventListener(_touchEventLookup[type] || type, func,
|
578
|
+
element.addEventListener(_touchEventLookup[type] || type, func, capture);
|
578
579
|
} else if (element.attachEvent) {
|
579
580
|
element.attachEvent("on" + type, func);
|
580
581
|
}
|
@@ -901,6 +902,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
901
902
|
this.lockAxis = vars.lockAxis;
|
902
903
|
this.autoScroll = vars.autoScroll || 0;
|
903
904
|
this.lockedAxis = null;
|
905
|
+
this.allowEventDefault = !!vars.allowEventDefault;
|
904
906
|
var type = (vars.type || (_isOldIE ? "top,left" : "x,y")).toLowerCase(),
|
905
907
|
xyMode = (type.indexOf("x") !== -1 || type.indexOf("y") !== -1),
|
906
908
|
rotationMode = (type.indexOf("rotation") !== -1),
|
@@ -915,7 +917,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
915
917
|
dragEndTime = 0,
|
916
918
|
checkAutoScrollBounds = false,
|
917
919
|
isClickable = vars.clickableTest || _isClickable,
|
918
|
-
enabled, scrollProxy, startPointerX, startPointerY, startElementX, startElementY, hasBounds, hasDragCallback, maxX, minX, maxY, minY, tempVars, cssVars, touch, touchID, rotationOrigin, dirty, old, snapX, snapY, isClicking, touchEventTarget, matrix, interrupted, clickTime, startScrollTop, startScrollLeft, applyObj,
|
920
|
+
enabled, scrollProxy, startPointerX, startPointerY, startElementX, startElementY, hasBounds, hasDragCallback, maxX, minX, maxY, minY, tempVars, cssVars, touch, touchID, rotationOrigin, dirty, old, snapX, snapY, isClicking, touchEventTarget, matrix, interrupted, clickTime, startScrollTop, startScrollLeft, applyObj, allowNativeTouchScrolling, touchDragAxis,
|
919
921
|
|
920
922
|
//this method gets called on every tick of TweenLite.ticker which allows us to synchronize the renders to the core engine (which is typically synchronized with the display refresh via requestAnimationFrame). This is an optimization - it's better than applying the values inside the "mousemove" or "touchmove" event handler which may get called many times inbetween refreshes.
|
921
923
|
render = function(suppressEvents) {
|
@@ -1015,7 +1017,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1015
1017
|
syncXY = function(skipOnUpdate, skipSnap) {
|
1016
1018
|
var snappedValue;
|
1017
1019
|
if (!target._gsTransform && (xyMode || rotationMode)) { //just in case the _gsTransform got wiped, like if the user called clearProps on the transform or something (very rare), doing an x tween forces a re-parsing of the transforms and population of the _gsTransform.
|
1018
|
-
TweenLite.set(target, {x:"+=0"});
|
1020
|
+
TweenLite.set(target, {x:"+=0", overwrite:false});
|
1019
1021
|
}
|
1020
1022
|
if (xyMode) {
|
1021
1023
|
self.y = target._gsTransform.y;
|
@@ -1129,10 +1131,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1129
1131
|
throwProps.rotation = _parseThrowProps(self, snapIsRaw ? snap : snap.rotation, maxX, minX, 1, forceZeroVelocity);
|
1130
1132
|
} else {
|
1131
1133
|
if (allowX) {
|
1132
|
-
throwProps[xProp] = _parseThrowProps(self, snapIsRaw ? snap : snap.x || snap.left || snap.scrollLeft, maxX, minX, scrollProxy ? -1 : 1, forceZeroVelocity || (self.
|
1134
|
+
throwProps[xProp] = _parseThrowProps(self, snapIsRaw ? snap : snap.x || snap.left || snap.scrollLeft, maxX, minX, scrollProxy ? -1 : 1, forceZeroVelocity || (self.lockedAxis === "x"));
|
1133
1135
|
}
|
1134
1136
|
if (allowY) {
|
1135
|
-
throwProps[yProp] = _parseThrowProps(self, snapIsRaw ? snap : snap.y || snap.top || snap.scrollTop, maxY, minY, scrollProxy ? -1 : 1, forceZeroVelocity || (self.
|
1137
|
+
throwProps[yProp] = _parseThrowProps(self, snapIsRaw ? snap : snap.y || snap.top || snap.scrollTop, maxY, minY, scrollProxy ? -1 : 1, forceZeroVelocity || (self.lockedAxis === "y"));
|
1136
1138
|
}
|
1137
1139
|
}
|
1138
1140
|
}
|
@@ -1247,7 +1249,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1247
1249
|
//called when the mouse is pressed (or touch starts)
|
1248
1250
|
onPress = function(e) {
|
1249
1251
|
var temp, i;
|
1250
|
-
if (!enabled || self.isPressed || !e) { //
|
1252
|
+
if (!enabled || self.isPressed || !e || (e.type === "mousedown" && _getTime() - clickTime < 30 && _touchEventLookup[self.pointerEvent.type])) { //when we DON'T preventDefault() in order to accommodate touch-scrolling and the user just taps, many browsers also fire a mousedown/mouseup sequence AFTER the touchstart/touchend sequence, thus it'd result in two quick "click" events being dispatched. This line senses that condition and halts it on the subsequent mousedown.
|
1251
1253
|
return;
|
1252
1254
|
}
|
1253
1255
|
interrupted = isTweening();
|
@@ -1261,8 +1263,8 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1261
1263
|
} else {
|
1262
1264
|
touchEventTarget = null;
|
1263
1265
|
_addListener(_doc, "mousemove", onMove); //attach these to the document instead of the box itself so that if the user's mouse moves too quickly (and off of the box), things still work.
|
1264
|
-
|
1265
1266
|
}
|
1267
|
+
touchDragAxis = null;
|
1266
1268
|
_addListener(_doc, "mouseup", onRelease);
|
1267
1269
|
if (e && e.target) {
|
1268
1270
|
_addListener(e.target, "mouseup", onRelease); //we also have to listen directly on the element because some browsers don't bubble up the event to the _doc on elements with contentEditable="true"
|
@@ -1274,9 +1276,10 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1274
1276
|
_setSelectable(triggers, true); //accommodates things like inputs and elements with contentEditable="true" (otherwise user couldn't drag to select text)
|
1275
1277
|
return;
|
1276
1278
|
}
|
1279
|
+
allowNativeTouchScrolling = (!touchEventTarget || allowX === allowY || scrollProxy || self.vars.allowNativeTouchScrolling === false) ? false : allowX ? "y" : "x";
|
1277
1280
|
if (_isOldIE) {
|
1278
1281
|
e = _populateIEEvent(e, true);
|
1279
|
-
} else
|
1282
|
+
} else if (!allowNativeTouchScrolling && !self.allowEventDefault) {
|
1280
1283
|
e.preventDefault();
|
1281
1284
|
if (e.preventManipulation) {
|
1282
1285
|
e.preventManipulation(); //for some Microsoft browsers
|
@@ -1294,12 +1297,12 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1294
1297
|
_addToRenderQueue(render); //causes the Draggable to render on each "tick" of TweenLite.ticker (performance optimization - updating values in a mousemove can cause them to happen too frequently, like multiple times between frame redraws which is wasteful, and it also prevents values from updating properly in IE8)
|
1295
1298
|
startPointerY = self.pointerY = e.pageY; //record the starting x and y so that we can calculate the movement from the original in _onMouseMove
|
1296
1299
|
startPointerX = self.pointerX = e.pageX;
|
1297
|
-
if (self.autoScroll
|
1300
|
+
if (allowNativeTouchScrolling || self.autoScroll) {
|
1298
1301
|
_recordMaxScrolls(target.parentNode);
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1302
|
-
|
1302
|
+
}
|
1303
|
+
if (self.autoScroll && !rotationMode && !scrollProxy && target.parentNode && !target.getBBox && target.parentNode._gsMaxScrollX && !_placeholderDiv.parentNode) {//add a placeholder div to prevent the parent container from collapsing when the user drags the element left.
|
1304
|
+
_placeholderDiv.style.width = (target.parentNode.scrollWidth) + "px";
|
1305
|
+
target.parentNode.appendChild(_placeholderDiv);
|
1303
1306
|
}
|
1304
1307
|
recordStartPositions();
|
1305
1308
|
if (matrix) {
|
@@ -1331,20 +1334,13 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1331
1334
|
|
1332
1335
|
//called every time the mouse/touch moves
|
1333
1336
|
onMove = function(e) {
|
1337
|
+
var originalEvent = e,
|
1338
|
+
touches, pointerX, pointerY, i;
|
1334
1339
|
if (!enabled || _isMultiTouching || !self.isPressed || !e) {
|
1335
1340
|
return;
|
1336
1341
|
}
|
1337
|
-
if (_isOldIE) {
|
1338
|
-
e = _populateIEEvent(e, true);
|
1339
|
-
} else {
|
1340
|
-
e.preventDefault();
|
1341
|
-
if (e.preventManipulation) { //for some Microsoft browsers
|
1342
|
-
e.preventManipulation();
|
1343
|
-
}
|
1344
|
-
}
|
1345
1342
|
self.pointerEvent = e;
|
1346
|
-
|
1347
|
-
i;
|
1343
|
+
touches = e.changedTouches;
|
1348
1344
|
if (touches) { //touch events store the data slightly differently
|
1349
1345
|
e = touches[0];
|
1350
1346
|
if (e !== touch && e.identifier !== touchID) { //Usually changedTouches[0] will be what we're looking for, but in case it's not, look through the rest of the array...(and Android browsers don't reuse the event like iOS)
|
@@ -1357,6 +1353,36 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1357
1353
|
} else if (e.pointerId && touchID && e.pointerId !== touchID) { //for some Microsoft browsers, we must attach the listener to the doc rather than the trigger so that when the finger moves outside the bounds of the trigger, things still work. So if the event we're receiving has a pointerId that doesn't match the touchID, ignore it (for multi-touch)
|
1358
1354
|
return;
|
1359
1355
|
}
|
1356
|
+
if (_isOldIE) {
|
1357
|
+
e = _populateIEEvent(e, true);
|
1358
|
+
} else {
|
1359
|
+
if (touchEventTarget && allowNativeTouchScrolling && !touchDragAxis) { //Android browsers force us to decide on the first "touchmove" event if we should allow the default (scrolling) behavior or preventDefault(). Otherwise, a "touchcancel" will be fired and then no "touchmove" or "touchend" will fire during the scrolling (no good).
|
1360
|
+
pointerX = e.pageX;
|
1361
|
+
pointerY = e.pageY;
|
1362
|
+
if (matrix) {
|
1363
|
+
i = pointerX * matrix[0] + pointerY * matrix[2] + matrix[4];
|
1364
|
+
pointerY = pointerX * matrix[1] + pointerY * matrix[3] + matrix[5];
|
1365
|
+
pointerX = i;
|
1366
|
+
}
|
1367
|
+
touchDragAxis = (Math.abs(pointerX - startPointerX) > Math.abs(pointerY - startPointerY) && allowX) ? "x" : "y";
|
1368
|
+
if (self.vars.lockAxisOnTouchScroll !== false) {
|
1369
|
+
self.lockedAxis = (touchDragAxis === "x") ? "y" : "x";
|
1370
|
+
if (typeof(self.vars.onLockAxis) === "function") {
|
1371
|
+
self.vars.onLockAxis.call(self, originalEvent);
|
1372
|
+
}
|
1373
|
+
}
|
1374
|
+
if (_isAndroid && allowNativeTouchScrolling === touchDragAxis) {
|
1375
|
+
onRelease(originalEvent);
|
1376
|
+
return;
|
1377
|
+
}
|
1378
|
+
}
|
1379
|
+
if (!self.allowEventDefault && (!allowNativeTouchScrolling || (touchDragAxis && allowNativeTouchScrolling !== touchDragAxis)) && originalEvent.cancelable !== false) {
|
1380
|
+
originalEvent.preventDefault();
|
1381
|
+
if (originalEvent.preventManipulation) { //for some Microsoft browsers
|
1382
|
+
originalEvent.preventManipulation();
|
1383
|
+
}
|
1384
|
+
}
|
1385
|
+
}
|
1360
1386
|
if (self.autoScroll) {
|
1361
1387
|
checkAutoScrollBounds = true;
|
1362
1388
|
}
|
@@ -1396,13 +1422,18 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1396
1422
|
if (xChange < minimumMovement && xChange > -minimumMovement) {
|
1397
1423
|
xChange = 0;
|
1398
1424
|
}
|
1399
|
-
if (self.lockAxis && (xChange || yChange)) {
|
1400
|
-
|
1425
|
+
if ((self.lockAxis || self.lockedAxis) && (xChange || yChange)) {
|
1426
|
+
temp = self.lockedAxis;
|
1427
|
+
if (!temp) {
|
1428
|
+
self.lockedAxis = temp = (allowX && Math.abs(xChange) > Math.abs(yChange)) ? "y" : allowY ? "x" : null;
|
1429
|
+
if (temp && typeof(self.vars.onLockAxis) === "function") {
|
1430
|
+
self.vars.onLockAxis.call(self, self.pointerEvent);
|
1431
|
+
}
|
1432
|
+
}
|
1433
|
+
if (temp === "y") {
|
1401
1434
|
yChange = 0;
|
1402
|
-
|
1403
|
-
} else if (allowY) {
|
1435
|
+
} else if (temp === "x") {
|
1404
1436
|
xChange = 0;
|
1405
|
-
self.lockedAxis = "x";
|
1406
1437
|
}
|
1407
1438
|
}
|
1408
1439
|
x = startElementX + xChange * dragTolerance;
|
@@ -1451,7 +1482,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1451
1482
|
|
1452
1483
|
//called when the mouse/touch is released
|
1453
1484
|
onRelease = function(e, force) {
|
1454
|
-
if (!enabled || e && touchID && !force && e.pointerId && e.pointerId !== touchID) { //for some Microsoft browsers, we must attach the listener to the doc rather than the trigger so that when the finger moves outside the bounds of the trigger, things still work. So if the event we're receiving has a pointerId that doesn't match the touchID, ignore it (for multi-touch)
|
1485
|
+
if (!enabled || !self.isPressed || e && touchID && !force && e.pointerId && e.pointerId !== touchID) { //for some Microsoft browsers, we must attach the listener to the doc rather than the trigger so that when the finger moves outside the bounds of the trigger, things still work. So if the event we're receiving has a pointerId that doesn't match the touchID, ignore it (for multi-touch)
|
1455
1486
|
return;
|
1456
1487
|
}
|
1457
1488
|
self.isPressed = false;
|
@@ -1520,19 +1551,22 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1520
1551
|
animate(vars.throwProps);
|
1521
1552
|
}
|
1522
1553
|
_dispatchEvent(self, "release", "onRelease");
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1526
|
-
eventTarget.click()
|
1527
|
-
|
1528
|
-
|
1529
|
-
|
1530
|
-
|
1554
|
+
if (!_isAndroid || originalEvent.type !== "touchmove") { //to accommodate native scrolling on Android devices, we have to immediately call onRelease() on the first touchmove event, but that shouldn't trigger a "click".
|
1555
|
+
_dispatchEvent(self, "click", "onClick");
|
1556
|
+
eventTarget = originalEvent.target || originalEvent.srcElement || target; //old IE uses srcElement
|
1557
|
+
if (eventTarget.click) { //some browsers (like mobile Safari) don't properly trigger the click event
|
1558
|
+
eventTarget.click();
|
1559
|
+
}
|
1560
|
+
else if (_doc.createEvent) {
|
1561
|
+
syntheticEvent = _doc.createEvent("MouseEvents");
|
1562
|
+
syntheticEvent.initEvent("click", true, true);
|
1563
|
+
eventTarget.dispatchEvent(syntheticEvent);
|
1564
|
+
}
|
1565
|
+
clickTime = _getTime();
|
1531
1566
|
}
|
1532
|
-
clickTime = _getTime();
|
1533
1567
|
} else {
|
1534
1568
|
animate(vars.throwProps); //will skip if throwProps isn't defined or ThrowPropsPlugin isn't loaded.
|
1535
|
-
if (!_isOldIE && originalEvent && (vars.dragClickables || !isClickable.call(self, originalEvent.target)) && wasDragging) {
|
1569
|
+
if (!_isOldIE && !self.allowEventDefault && originalEvent && (vars.dragClickables || !isClickable.call(self, originalEvent.target)) && wasDragging && (!allowNativeTouchScrolling || (touchDragAxis && allowNativeTouchScrolling === touchDragAxis)) && originalEvent.cancelable !== false) {
|
1536
1570
|
originalEvent.preventDefault();
|
1537
1571
|
if (originalEvent.preventManipulation) {
|
1538
1572
|
originalEvent.preventManipulation(); //for some Microsoft browsers
|
@@ -1563,11 +1597,12 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1563
1597
|
|
1564
1598
|
onClick = function(e) {
|
1565
1599
|
var time = _getTime(),
|
1566
|
-
recentlyClicked = time - clickTime < 40
|
1567
|
-
|
1600
|
+
recentlyClicked = time - clickTime < 40,
|
1601
|
+
recentlyDragged = time - dragEndTime < 40;
|
1602
|
+
if (self.isPressed || recentlyDragged || recentlyClicked) {
|
1568
1603
|
if (e.preventDefault) {
|
1569
1604
|
e.preventDefault();
|
1570
|
-
if (recentlyClicked) {
|
1605
|
+
if (recentlyClicked || (recentlyDragged && self.vars.suppressClickOnDrag !== false)) {
|
1571
1606
|
e.stopImmediatePropagation(); //otherwise some browsers bubble up click events, creating a duplicate.
|
1572
1607
|
}
|
1573
1608
|
} else {
|
@@ -1670,7 +1705,6 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1670
1705
|
var x = self.x,
|
1671
1706
|
y = self.y;
|
1672
1707
|
updateMatrix();
|
1673
|
-
updateScroll();
|
1674
1708
|
if (applyBounds) {
|
1675
1709
|
self.applyBounds();
|
1676
1710
|
} else {
|
@@ -1693,12 +1727,12 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1693
1727
|
trigger = triggers[i];
|
1694
1728
|
_addListener(trigger, "mousedown", onPress);
|
1695
1729
|
_addListener(trigger, "touchstart", onPress);
|
1696
|
-
_addListener(trigger, "click", onClick);
|
1730
|
+
_addListener(trigger, "click", onClick, true);
|
1697
1731
|
if (!rotationMode) {
|
1698
1732
|
_setStyle(trigger, "cursor", vars.cursor || "move");
|
1699
1733
|
}
|
1700
1734
|
_setStyle(trigger, "touchCallout", "none");
|
1701
|
-
_setStyle(trigger, "touchAction", "none");
|
1735
|
+
_setStyle(trigger, "touchAction", (allowX === allowY || scrollProxy) ? "none" : allowX ? "pan-y" : "pan-x");
|
1702
1736
|
}
|
1703
1737
|
_setSelectable(triggers, false);
|
1704
1738
|
}
|
@@ -1715,12 +1749,12 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1715
1749
|
if (scrollProxy) {
|
1716
1750
|
scrollProxy.element._gsDragID = id;
|
1717
1751
|
}
|
1718
|
-
TweenLite.set(target, {x:"+=0"}); //simply ensures that there's a _gsTransform on the element.
|
1752
|
+
TweenLite.set(target, {x:"+=0", overwrite:false}); //simply ensures that there's a _gsTransform on the element.
|
1719
1753
|
applyObj = {
|
1720
1754
|
t:target,
|
1721
1755
|
data:_isOldIE ? cssVars : target._gsTransform,
|
1722
1756
|
tween:{},
|
1723
|
-
setRatio:(_isOldIE ? function() { TweenLite.set(target, tempVars); } : CSSPlugin._internals.set3DTransformRatio)
|
1757
|
+
setRatio:(_isOldIE ? function() { TweenLite.set(target, tempVars); } : CSSPlugin._internals.setTransformRatio || CSSPlugin._internals.set3DTransformRatio)
|
1724
1758
|
};
|
1725
1759
|
this.update(true);
|
1726
1760
|
return self;
|
@@ -1739,8 +1773,8 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1739
1773
|
i = triggers.length;
|
1740
1774
|
while (--i > -1) {
|
1741
1775
|
trigger = triggers[i];
|
1742
|
-
_setStyle(trigger, "touchCallout",
|
1743
|
-
_setStyle(trigger, "
|
1776
|
+
_setStyle(trigger, "touchCallout", null);
|
1777
|
+
_setStyle(trigger, "touchAction", null);
|
1744
1778
|
_removeListener(trigger, "mousedown", onPress);
|
1745
1779
|
_removeListener(trigger, "touchstart", onPress);
|
1746
1780
|
_removeListener(trigger, "click", onClick);
|
@@ -1822,7 +1856,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1822
1856
|
p.constructor = Draggable;
|
1823
1857
|
p.pointerX = p.pointerY = 0;
|
1824
1858
|
p.isDragging = p.isPressed = false;
|
1825
|
-
Draggable.version = "0.
|
1859
|
+
Draggable.version = "0.13.0";
|
1826
1860
|
Draggable.zIndex = 1000;
|
1827
1861
|
|
1828
1862
|
_addListener(_doc, "touchcancel", function() {
|
@@ -1895,7 +1929,7 @@ var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(globa
|
|
1895
1929
|
return (overlap.width > threshold && overlap.height > threshold);
|
1896
1930
|
};
|
1897
1931
|
|
1898
|
-
_placeholderDiv.style.cssText = "visibility:hidden;
|
1932
|
+
_placeholderDiv.style.cssText = "visibility:hidden;height:1px;top:-1px;pointer-events:none;position:relative;clear:both;";
|
1899
1933
|
|
1900
1934
|
return Draggable;
|
1901
1935
|
|