Perform synthetic bubbling through event target ancestors

This commit is contained in:
Nathan Sobo
2014-09-05 08:39:14 -06:00
parent decc983420
commit a075aa2b07
2 changed files with 24 additions and 3 deletions

View File

@@ -16,6 +16,10 @@ class CommandRegistry
currentTarget: get: -> currentTarget
currentTarget = event.target
for listener in @listenersByCommandName[event.type]
if event.target.webkitMatchesSelector(listener.selector)
listener.callback.call(currentTarget, syntheticEvent)
loop
for listener in @listenersByCommandName[event.type]
if currentTarget.webkitMatchesSelector(listener.selector)
listener.callback.call(currentTarget, syntheticEvent)
break if currentTarget is @rootNode
currentTarget = currentTarget.parentNode