Permalink
Browse files

Use emulated events for click, when Emulator is active

  • Loading branch information...
nvh committed Feb 16, 2018
1 parent 64a7037 commit aaf80b0a072788c95ea5a55e69519aa281d09b9b
Showing with 6 additions and 2 deletions.
  1. +6 −2 framer/Events.coffee
View
@@ -34,10 +34,14 @@ Events.enableEmulatedTouchEvents = (enable=true) ->
Events.TouchStart = Events.MouseDown
Events.TouchEnd = Events.MouseUp
Events.TouchMove = Events.MouseMove
# When we are simulating touch events, click should use the simulated touch-event
Events.Click = "touchend"
else
Events.TouchStart = "touchstart"
Events.TouchEnd = "touchend"
Events.TouchMove = "touchmove"
# When not simulating, click should be based on if touch is supported or not
Events.Click = if Utils.isTouch() then "touchend" else "mouseup"
# Let's make sure the touch events work on desktop too
Events.enableEmulatedTouchEvents(not Utils.isTouch())
@@ -51,8 +55,8 @@ if supportsPointerEvents
Events.TouchStart = Events.PointerDown
Events.TouchEnd = Events.PointerUp
Events.TouchMove = Events.PointerMove
Events.Click = Events.TouchEnd
# Use pointerEvents for click
Events.Click = Events.PointerUp
# Animation events
Events.AnimationStart = "start"

0 comments on commit aaf80b0

Please sign in to comment.