Skip to content
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

Way to trigger the popover from the controller or component #23

Open
karjac14 opened this issue Mar 20, 2018 · 5 comments
Open

Way to trigger the popover from the controller or component #23

karjac14 opened this issue Mar 20, 2018 · 5 comments
Assignees

Comments

@karjac14
Copy link

Is there a way to trigger hide/show the popover from the controller's or component's action, instead of from click, hover and focus.

Thanks.

@nadnoslen
Copy link
Member

Hey @karjac14,
That's an interesting use-case that I hadn't needed to consider until now. I'm going to open up the dummy app and try a couple of things. I'll get you an answer soon... It might start out as a hack but I will come up with something more elegant after putting some thought into it. Cheers.

@nadnoslen nadnoslen self-assigned this Mar 21, 2018
@nadnoslen
Copy link
Member

Hey @karjac14,
My hack idea was to simply use jQuery+Bootstrap3 to manually invoke the popover but that won't work because of the way that I've created the content and title components. These elements will not appear in the DOM until they have been "shown" and as such you can't just select them and tell them to show themselves!

Anyway, I have another idea that uses closures. I'll start working on it this afternoon. It will require a code change and new release of the ember-cli-bootstrap3-popover add-on.

Cheers.

@karjac14
Copy link
Author

karjac14 commented Mar 22, 2018

Hey @nadnoslen, Thanks for the response. For now, I used a jQuery hack too. I think my use-case is pretty unusual, and popOvers should show up based where (positionally) user had clicked. Though the
original bootstrap has a method of $.(#mybutton).popover('show') where we can invoke a show or hide from the JS side.

If you come up with something elegant, I'm following this thread and I will know. Thanks in advance. This library package is great.

@mrfisher8432
Copy link

I like the closure idea too. I was thinking that we could add another param to the main handlebars code where a user could specify a class or id, and then use that selector in the javascript to manipulate the popover. IDs would be good in the case of using multiple popovers on the same page. Just a thought.

@karjac14 karjac14 changed the title Way to trigger the popover from the controller or componet Way to trigger the popover from the controller or component Mar 22, 2018
@nadnoslen
Copy link
Member

Thanks for the positive feedback. I'm drowning on another project at the moment but I will put together a plan for a closure routine and get the add-on upgraded as soon as possible.

Cheers.

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

No branches or pull requests

3 participants