Working on stacked buttons.
This commit is contained in:
+5
-29
@@ -59,15 +59,7 @@ export class FrameTarget {
|
||||
let point = pointMap.get(key)
|
||||
let p = Points.fromPageToNode(this.frame, point)
|
||||
let touchTarget = doc.elementFromPoint(p.x, p.y)
|
||||
let touch = new Touch(
|
||||
undefined,
|
||||
touchTarget,
|
||||
key,
|
||||
p.x,
|
||||
p.y,
|
||||
p.x,
|
||||
p.y
|
||||
)
|
||||
let touch = new Touch(undefined, touchTarget, key, p.x, p.y, p.x, p.y)
|
||||
touches.push(touch)
|
||||
}
|
||||
return new TouchList(...touches)
|
||||
@@ -102,12 +94,7 @@ export class FrameTarget {
|
||||
this.target.dispatchEvent(touchEvent)
|
||||
}
|
||||
|
||||
simulateTouchEventSafari(
|
||||
type,
|
||||
point,
|
||||
pointMap,
|
||||
touchEventKey = 'targetTouches'
|
||||
) {
|
||||
simulateTouchEventSafari(type, point, pointMap, touchEventKey = 'targetTouches') {
|
||||
let p = Points.fromPageToNode(this.frame, point)
|
||||
let data = {
|
||||
view: this.frame.contentWindow,
|
||||
@@ -131,9 +118,7 @@ export class FrameTarget {
|
||||
}
|
||||
|
||||
isMouseLikeEvent(event) {
|
||||
return (
|
||||
event.type.startsWith('mouse') || event.type.startsWith('pointer')
|
||||
)
|
||||
return event.type.startsWith('mouse') || event.type.startsWith('pointer')
|
||||
}
|
||||
|
||||
onStart(event, interaction) {
|
||||
@@ -142,11 +127,7 @@ export class FrameTarget {
|
||||
if (this.isMouseLikeEvent(event)) {
|
||||
this.simulateMouseEvent('mousedown', point)
|
||||
} else {
|
||||
this.simulateTouchEvent(
|
||||
'touchstart',
|
||||
point,
|
||||
interaction.current
|
||||
)
|
||||
this.simulateTouchEvent('touchstart', point, interaction.current)
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -170,12 +151,7 @@ export class FrameTarget {
|
||||
if (this.isMouseLikeEvent(event)) {
|
||||
this.simulateMouseEvent('mouseend', point)
|
||||
} else {
|
||||
this.simulateTouchEvent(
|
||||
'touchend',
|
||||
point,
|
||||
interaction.ended,
|
||||
'changedTouches'
|
||||
)
|
||||
this.simulateTouchEvent('touchend', point, interaction.ended, 'changedTouches')
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user