()
| 121 | }; |
| 122 | |
| 123 | const tryToCapturePan = (): boolean => { |
| 124 | if (!gesture.capture()) { |
| 125 | return false; |
| 126 | } |
| 127 | hasCapturedPan = true; |
| 128 | hasFiredStart = false; |
| 129 | |
| 130 | // reset start position since the real user-land event starts here |
| 131 | // If the pan detector threshold is big, not resetting the start position |
| 132 | // will cause a jump in the animation equal to the detector threshold. |
| 133 | // the array of positions used to calculate the gesture velocity does not |
| 134 | // need to be cleaned, more points in the positions array always results in a |
| 135 | // more accurate value of the velocity. |
| 136 | detail.startX = detail.currentX; |
| 137 | detail.startY = detail.currentY; |
| 138 | detail.startTime = detail.currentTime; |
| 139 | |
| 140 | if (onWillStart) { |
| 141 | onWillStart(detail).then(fireOnStart); |
| 142 | } else { |
| 143 | fireOnStart(); |
| 144 | } |
| 145 | return true; |
| 146 | }; |
| 147 | |
| 148 | const blurActiveElement = () => { |
| 149 | if (typeof document !== 'undefined') { |
no test coverage detected