-
Notifications
You must be signed in to change notification settings - Fork 62
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
jQuery selecting contents of a wormhole from inside component #31
Comments
Likely ember-wormhole should just override .$() to do what people expect. If it is rendered in place it uses its element if it has been wormholed it should use the destinationElement. A concern though, it could scope it to more. I was thinking it would be safer originally for ember-wormhole to move a single static element it rendered in its layout, but there are use cases where having an extra element complicates. Like moving a element-less template into the title tag. |
@krisselden What do you think about a component property to opt into such a static container? |
Could work in tandem with an override of |
I think the wormhole is invoked inside the component with |
Problem restated without pod-style file names, and showing an action:
|
My suggestion for a better way to do this, if you want to avoid
and
|
I'm using an
ember-wormhole
inside a component, and am trying to access an element that's inside the wormhole withthis.$()
in the component.component/template.hbs
component/component.js
As mentioned in the sample above, using
this.$
doesn't work, asthis.$
is scoped to the component view,ember-wormhole
moves the contents out of that view, meaning the component view is essentially empty (the contents I'm wanting to access are inside the wormhole).To circumvent this, I currently have to just do a global selection with
Ember.$
in my component, and target the wormhole the contents are moved to (as seen above).Is there a better way to do this currently, that doesn't involve a global selection with
Ember.$
?The text was updated successfully, but these errors were encountered: