-
Notifications
You must be signed in to change notification settings - Fork 63
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
before and after callbacks #31
Comments
I'm quite not sure about this. |
let me try this out tonight, but I figured you take so much care separating the concerns so that this sort of thing made sense to be with the layout rather than the router. |
The situation is a little bit tricky. Lets say you would like to transition from one page to another with a content slide - left to right or right to left for instance you would need 2 templates rendered at the same time on route click. The current page/slide sits on screen and the next slide sits offscreen. Once you change the route the two templates would change places with an animation. I can only see this working if you use two or more different regions. You also need some sort of config one each route to keep track in which state it is. You could set up a rule which says that only one region is visible at a time and always the non visible region will be used for the next content population. Here is a quick prototype to illustrate what I would like to do.
This is all super static and will probably fall apart as soon as subscription come into play. |
Could you use |
@teejayhh did you ever get your transitions working? |
Maybe a callback after onCreated, onRendered, etc? For anything that needs to be done on routing after those events. For me, I sometimes add event listeners last in onRendered that I want to emit to on routing. |
I used this workaround as after-callback (in the specific case of rendering a template in the flow-router): arillo/meteor-flow-router-helpers#23 (comment) |
First of all I really like meteorhacks libs and I wanted to give flowrouter/ flowlayout a shot. So I played around with it a little bit and tried to implement transitions between route changes. As far as I can see there is no code which gets called just after a template has been added to the dom or just before it gets removed from the dom.
It is possible to use -> http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#mutation-observers and bind event listeners to templates. Those dom events should be bound to the regions. I am just brainstorming here and would like your opinion if this could be a good solution without touching the layout component at all. Or if it would be better to implement callbacks which delay the reset or on after insert?
Cheers Thomas
The text was updated successfully, but these errors were encountered: