-
Notifications
You must be signed in to change notification settings - Fork 397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.on('*') is possible, but there's no way to get event name #1249
Comments
Maybe ractive.on('*', function () {
console.log(this.event.name + " event fired:", arguments);
// if it's a proxy event, would have all the usual stuff
this.event.original.preventDefault();
console.log( this.event.keypath );
}); To be honest, it should probably have been that way all along - then we wouldn't have the discrepancy between programmatically-fired events and proxy events (whose arguments have to be unshifted to accommodate the |
That looks pretty neat! |
Btw, this'd make it possible for the Ractive adaptor to support events propagated from child to parent. The adaptor can listen for |
+1 for this.event proposal. We are looking to use the ractive-ractive adaptor for some large UI work. |
Are |
@codler added with event bubbling, which I don't think has been added to the docs yet (mea culpa). Leverages dot notation: |
#1263 Addresses this (but not the first arg event object deprecation, will do separate PR for that).
|
@codler it's partially documented at http://docs.ractivejs.org/latest/components#events |
Thanks @evs-chris! |
You can do this:
But this will only get you the event's arguments, but not the event name:
I'm not sure on what the best solution for this is etiher, but perhaps there should be a way to determine what was the last event fired.
The text was updated successfully, but these errors were encountered: