Permalink
Browse files

Making behaviour for ignoring clicks while dragging better

  • Loading branch information...
koenbok committed Jan 28, 2016
1 parent 6c1eee0 commit b2b197d5055fd4bc5eaddc007ca9f1b3d852c4d6
Showing with 1 addition and 6 deletions.
  1. +1 −6 framer/Layer.coffee
@@ -73,7 +73,6 @@ class exports.Layer extends BaseClass
# Private setting for canceling of click event if wrapped in moved draggable
@_cancelClickEventInDragSession = true
@_cancelClickEventInDragSessionTolerance = 4
# We have to create the element before we set the defaults
@_createElement()
@@ -943,11 +942,7 @@ class exports.Layer extends BaseClass
if @_cancelClickEventInDragSession
if eventName is Events.Click
parentDraggableLayer = @_parentDraggableLayer()
if parentDraggableLayer
offset = parentDraggableLayer.draggable.offset
return if Math.abs(0 - offset.x) > @_cancelClickEventInDragSessionTolerance
return if Math.abs(0 - offset.y) > @_cancelClickEventInDragSessionTolerance
return if @_parentDraggableLayer()?.draggable.isMoving
# Always scope the event this to the layer and pass the layer as
# last argument for every event.

0 comments on commit b2b197d

Please sign in to comment.