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:
parent
30cf21f778
commit
7adfa8c19f
1 changed files with 14 additions and 3 deletions
|
@ -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)'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue