Skip to content

Instantly share code, notes, and snippets.

@danott
Created July 24, 2014 23:38
Show Gist options
  • Save danott/ba5f3f3ce5fdab5fde1b to your computer and use it in GitHub Desktop.
Save danott/ba5f3f3ce5fdab5fde1b to your computer and use it in GitHub Desktop.
How to propogate events up the batman view tree, similar to EventBinding
class App.BehavesLikeEventBindingView extends Batman.View
fireOnSelfAndNearestAncestor: (event, args...) ->
@[event]?.apply(@, args)
if target = @superview?.targetForKeypath(event)
target[event].apply(target, args)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment