skrollr-rails 0.6.16 → 0.6.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/skrollr-rails/version.rb +1 -1
- data/vendor/assets/javascripts/skrollr.js +23 -14
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f2a4e524513a3fcc1bce8801cd4e0c4988582d1
|
4
|
+
data.tar.gz: 929ee48321fdc2726e0592fbf883123ebe30370f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afdc7eff57a77a7cff835b81efd9394c7e28a01cf904c16683a52407ed5e2b9fa65f0db78b41cb95bef7e9545e1682afdc1751a73508126d9bf5e08db3c2fdb9
|
7
|
+
data.tar.gz: c6d2fca63f09370db4b16b36790ac0d564325c6543ff8ecaf21a04d66a5a7a17522780548199d3c768c04495c69aa080b2d41a3893ac3a73e5dc9f67075d4e0a
|
@@ -19,7 +19,7 @@
|
|
19
19
|
init: function(options) {
|
20
20
|
return _instance || new Skrollr(options);
|
21
21
|
},
|
22
|
-
VERSION: '0.6.
|
22
|
+
VERSION: '0.6.17'
|
23
23
|
};
|
24
24
|
|
25
25
|
//Minify optimization.
|
@@ -60,6 +60,8 @@
|
|
60
60
|
//The property which will be added to the DOM element to hold the ID of the skrollable.
|
61
61
|
var SKROLLABLE_ID_DOM_PROPERTY = '___skrollable_id';
|
62
62
|
|
63
|
+
var rxTouchIgnoreTags = /^(?:input|textarea|button|select)$/i;
|
64
|
+
|
63
65
|
var rxTrim = /^\s+|\s+$/g;
|
64
66
|
|
65
67
|
//Find all data-attributes. data-[_constant]-[offset]-[anchor]-[anchor].
|
@@ -670,6 +672,7 @@
|
|
670
672
|
var initialElement;
|
671
673
|
var initialTouchY;
|
672
674
|
var initialTouchX;
|
675
|
+
var currentElement;
|
673
676
|
var currentTouchY;
|
674
677
|
var currentTouchX;
|
675
678
|
var lastTouchY;
|
@@ -681,14 +684,23 @@
|
|
681
684
|
var deltaTime;
|
682
685
|
|
683
686
|
_addEvent(documentElement, [EVENT_TOUCHSTART, EVENT_TOUCHMOVE, EVENT_TOUCHCANCEL, EVENT_TOUCHEND].join(' '), function(e) {
|
684
|
-
e.preventDefault();
|
685
|
-
|
686
687
|
var touch = e.changedTouches[0];
|
687
688
|
|
689
|
+
currentElement = e.target;
|
690
|
+
|
691
|
+
//We don't want text nodes.
|
692
|
+
while(currentElement.nodeType === 3) {
|
693
|
+
currentElement = currentElement.parentNode;
|
694
|
+
}
|
695
|
+
|
688
696
|
currentTouchY = touch.clientY;
|
689
697
|
currentTouchX = touch.clientX;
|
690
698
|
currentTouchTime = e.timeStamp;
|
691
699
|
|
700
|
+
if(!rxTouchIgnoreTags.test(currentElement.tagName)) {
|
701
|
+
e.preventDefault();
|
702
|
+
}
|
703
|
+
|
692
704
|
switch(e.type) {
|
693
705
|
case EVENT_TOUCHSTART:
|
694
706
|
//The last element we tapped on.
|
@@ -698,12 +710,7 @@
|
|
698
710
|
|
699
711
|
_instance.stopAnimateTo();
|
700
712
|
|
701
|
-
initialElement =
|
702
|
-
|
703
|
-
//We don't want text nodes.
|
704
|
-
while(initialElement.nodeType === 3) {
|
705
|
-
initialElement = initialElement.parentNode;
|
706
|
-
}
|
713
|
+
initialElement = currentElement;
|
707
714
|
|
708
715
|
initialTouchY = lastTouchY = currentTouchY;
|
709
716
|
initialTouchX = currentTouchX;
|
@@ -728,12 +735,14 @@
|
|
728
735
|
|
729
736
|
//Check if it was more like a tap (moved less than 7px).
|
730
737
|
if(distance2 < 49) {
|
731
|
-
initialElement.
|
738
|
+
if(!rxTouchIgnoreTags.test(initialElement.tagName)) {
|
739
|
+
initialElement.focus();
|
732
740
|
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
741
|
+
//It was a tap, click the element.
|
742
|
+
var clickEvent = document.createEvent('MouseEvents');
|
743
|
+
clickEvent.initMouseEvent('click', true, true, e.view, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, 0, null);
|
744
|
+
initialElement.dispatchEvent(clickEvent);
|
745
|
+
}
|
737
746
|
|
738
747
|
return;
|
739
748
|
}
|