1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-05 10:39:25 +02:00

Touch events mostly fixed.

This commit is contained in:
Gunther Brunner 2014-05-27 20:03:41 +09:00
parent 30cf21f778
commit 7adfa8c19f

View file

@ -28,9 +28,20 @@ module.exports = function DeviceScreenDirective($document, ScalingService, Vendo
function sendTouch(type, e) {
var x = e.offsetX || e.layerX || 0
, y = e.offsetY || e.layerY || 0
, r = scope.device.display.orientation
, scaled = scaler.coords(boundingWidth, boundingHeight, x, y, r)
var y = e.offsetY || e.layerY || 0
var r = scope.device.display.orientation
if (BrowserInfo.touch) {
if (e.touches && e.touches.length) {
x = e.touches[0].pageX
y = e.touches[0].pageY
} else if (e.changedTouches && e.changedTouches.length) {
x = e.changedTouches[0].pageX
y = e.changedTouches[0].pageY
}
}
var scaled = scaler.coords(boundingWidth, boundingHeight, x, y, r)
finger[0].style[cssTransform] =
'translate3d(' + x + 'px,' + y + 'px,0)'