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

only a single delegated tooltip selector is supported on a node #14167

Closed
ashanbrown opened this issue Jul 17, 2014 · 6 comments
Closed

only a single delegated tooltip selector is supported on a node #14167

ashanbrown opened this issue Jul 17, 2014 · 6 comments

Comments

@ashanbrown
Copy link
Contributor

Based on my experience and my reading of the code, you only can only call tooltip once on a node, so if you want to set up multiple selectors with different default values, behaviors, etc, you are out of luck. In the following example, only "Hover over me" gets a tooltip:

<span title="hover-tooltip" class="hover-tooltip">Hover over me</span>
<span title="click-tooltip" class="click-tooltip">Click on me</span>
<script>
  $('body').tooltip({selector: '.hover-tooltip', trigger: 'hover'});
  $('body').tooltip({selector: '.click-tooltip', trigger: 'click'});
</script>

Seems like it would be nice to be able to set up multiple delegated selectors on a node. Would probably require a bit of work though, but if there's an interest in this, I could work on a pull request.

@hnrch02
Copy link
Collaborator

hnrch02 commented Jul 17, 2014

Interesting. Could you compile a live test case demonstrating this? Preferably using something like JS Bin.

@hnrch02
Copy link
Collaborator

hnrch02 commented Jul 17, 2014

Also, implementing this would require a fair bit of change to the current tooltip plugin, not sure if that would be worth the hassle – you could add a wrapper and use that instead of the body to delegate from.

@ashanbrown
Copy link
Contributor Author

I can't seem to get tooltips to work at all on jsbin. It looks like it would require work, but having to restructure your html and your css to work around it is a bit of a pain. Also, in my case, I'm using turbolinks, so the layer of hierarchy would need to be between html and body unless I want to rebuild my handlers every time I fetch a page (which is what I am doing now).

@hnrch02
Copy link
Collaborator

hnrch02 commented Jul 17, 2014

Here's a bin.
I'm sure we'd take a PR into consideration, but as I said, can't guarantee anything.

@ashanbrown
Copy link
Contributor Author

Thanks for the bin. I should have been able to figure the bin out myself but I must not do my best work at that hour (I must have been running script before jquery was loaded).

Anyhow, I assume that popover has the same problem as well as any other delegated handlers. I'll take a look into it as well.

@mdo
Copy link
Member

mdo commented Aug 2, 2014

Closing for the pull request.

@mdo mdo closed this as completed Aug 2, 2014
hnrch02 pushed a commit that referenced this issue Oct 26, 2014
cvrebert added a commit that referenced this issue Dec 30, 2014
This reverts commit 1b32376.
This reverts PR #14189 because it caused major regressions.

Fixes #15168.

We'll try to revisit #14167's feature request in Bootstrap v4.

[skip validator]
@mdo mdo mentioned this issue Aug 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants