Created
July 24, 2014 23:38
-
-
Save danott/ba5f3f3ce5fdab5fde1b to your computer and use it in GitHub Desktop.
How to propogate events up the batman view tree, similar to EventBinding
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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