Skip to content

Emit "mounted" event on child views#31

Open
UhhhWaitWhat wants to merge 3 commits intoripplejs:masterfrom
UhhhWaitWhat:#30
Open

Emit "mounted" event on child views#31
UhhhWaitWhat wants to merge 3 commits intoripplejs:masterfrom
UhhhWaitWhat:#30

Conversation

@UhhhWaitWhat
Copy link

According to this documentation, a mounted event should be triggered, each time a view enters the DOM.

This implies, that each time a view is mounted, each of its child views (attached via .compose()) should emit a mounted event as well.

Currently this is not the case. I will look into this (I guess it should be fairly straightforward to implement this) and see if I can provide a pull-request, but for now I wanted to know your opinions of this, and if this would be indeed the correct, expected behavior.

Sorry about issue #30, I would have preferred to attach the PR to it, but apparently I am not quite familiar enough with github to do that. Therefore I closed #30 and continue here.

@UhhhWaitWhat UhhhWaitWhat changed the title Emit "mounted" event on child views (#30) Emit "mounted" event on child views May 24, 2014
@UhhhWaitWhat UhhhWaitWhat reopened this May 24, 2014
@bmcmahen
Copy link

@anthonyshort any chance this could be added? Seems like a fairly significant bug & something I just ran into myself.

@bmcmahen
Copy link

So it actually works perfectly fine. The key (which is stupidly obvious) is that you need to attach the ripple element to the DOM using one of the view's dom manipulation methods (i.e., view.appendTo(document.body)).

@anthonyshort
Copy link
Contributor

Yeah you have to use the methods otherwise the events won't be called. I could use mutation observers to see when the element gets added in anyway which would be kinda nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Emit "mounted" event on child views

3 participants