Permalink
Browse files

Refactor Events a bit

  • Loading branch information...
koenbok committed Sep 4, 2015
1 parent ecf3c54 commit e45456b493a44ff3179204967b216582da7f6edf
Showing with 14 additions and 10 deletions.
  1. +14 −10 framer/Events.coffee
@@ -4,23 +4,27 @@ Utils = require "./Utils"
Events = {}
if Utils.isTouch()
Events.TouchStart = "touchstart"
Events.TouchEnd = "touchend"
Events.TouchMove = "touchmove"
else
Events.TouchStart = "mousedown"
Events.TouchEnd = "mouseup"
Events.TouchMove = "mousemove"
Events.Click = Events.TouchEnd
# Standard touch events
Events.TouchStart = "touchstart"
Events.TouchEnd = "touchend"
Events.TouchMove = "touchmove"
# Standard dom events
Events.MouseUp = "mouseup"
Events.MouseDown = "mousedown"
Events.MouseOver = "mouseover"
Events.MouseOut = "mouseout"
Events.MouseMove = "mousemove"
Events.MouseWheel = "mousewheel"
# Let's make sure the touch events work on desktop too
if not Utils.isTouch()
Events.TouchStart = Events.MouseDown
Events.TouchEnd = Events.MouseUp
Events.TouchMove = Events.MouseMove
Events.Click = Events.TouchEnd
# Animation events
Events.AnimationStart = "start"
Events.AnimationStop = "stop"

0 comments on commit e45456b

Please sign in to comment.