Permalink
Browse files

Fix hint bug

Make sure we always detect layer/hint settings first.

Fixes: framer/company#2174
  • Loading branch information...
koenbok committed Aug 1, 2016
1 parent 0598f10 commit 36e778e456b77124f3df60968f909b752fc771dc
Showing with 10 additions and 10 deletions.
  1. +3 −3 framer/DOMEventManager.coffee
  2. +5 −5 framer/Extras/Hints.coffee
  3. +2 −2 framer/Layer.coffee
@@ -11,11 +11,11 @@ class DOMEventManagerElement extends EventEmitter
addListener: (eventName, listener, capture=false) ->
super(eventName, listener)
- @element.addEventListener(eventName, listener, false)
+ @element.addEventListener(eventName, listener, capture)
- removeListener: (eventName, listener) ->
+ removeListener: (eventName, listener, capture=false) ->
super(eventName, listener)
- @element.removeEventListener(eventName, listener, false)
+ @element.removeEventListener(eventName, listener, capture)
# Keep the DOM API working
addEventListener: @::addListener
View
@@ -7,11 +7,11 @@ class Hints
@_context.run =>
if Utils.isTouch()
- Events.wrap(document).addEventListener("touchstart", @_handleDown)
- Events.wrap(document).addEventListener("touchend", @_handleUp)
+ Events.wrap(document).addEventListener("touchstart", @_handleDown, capture=true)
+ Events.wrap(document).addEventListener("touchend", @_handleUp, capture=true)
else
- Events.wrap(document).addEventListener("mousedown", @_handleDown)
- Events.wrap(document).addEventListener("mouseup", @_handleUp)
+ Events.wrap(document).addEventListener("mousedown", @_handleDown, capture=true)
+ Events.wrap(document).addEventListener("mouseup", @_handleUp, capture=true)
_handleDown: (event) =>
@_target = event.target
@@ -22,7 +22,7 @@ class Hints
layer = Framer.CurrentContext.layerForElement(@_target)
# If this is a layer with interaction, we do not show any hints
- if layer and layer.willSeemToDoSomething(layer)
+ if layer and layer.willSeemToDoSomething()
return
@showHints()
View
@@ -1237,9 +1237,9 @@ class exports.Layer extends BaseClass
@showHint(frame)
# Tell the children to show their hints
- _.invokeMap(@children, "_showHint")
+ _.invoke(@children, "_showHint")
- willSeemToDoSomething: (targetLayer) ->
+ willSeemToDoSomething: ->
if @ignoreEvents
return false

0 comments on commit 36e778e

Please sign in to comment.