Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

$tooltipProvider - how do I actually use setTriggers() ? #625

Closed
franciscopreller opened this issue Jul 5, 2013 · 19 comments
Closed

$tooltipProvider - how do I actually use setTriggers() ? #625

franciscopreller opened this issue Jul 5, 2013 · 19 comments

Comments

@franciscopreller
Copy link

The documentation states that I am able to set new triggers using the $tooltipProvider and setTriggers() method, however I have so far been unable to achieve this.

I have included this in my module config:

$tooltipProvider.setTriggers({ 'inputInvalid' : 'inputValid' });

However it does not find the method. I dived into the source and see the method there, but it's tossed inside a $get method which then returns the dependencies. Perhaps I am doing something wrong here and I simply do not understand how to get the $tooltipProvider to work?

@pkozlowski-opensource
Copy link
Member

@franciscopreller Sends us a plunker (http://plnkr.co/) with what you've tried so far. Also, since this is a question, it should be asked on the mailing list ([email protected]).

@franciscopreller
Copy link
Author

Thanks, will move it to google groups then, was unsure where else to get help.

@baconmania
Copy link

@franciscopreller Did you ever figure out how to properly use setTriggers()? I looked for your post on Google Groups but wasn't able to find it.

@franciscopreller
Copy link
Author

@baconmania Hey, yes I did. Was something simple like updating from an old version. Became apparent when I set it up on plunker exactly the same and it worked as it should have.

@jabb0r
Copy link

jabb0r commented Aug 21, 2013

Francis, could you please provide your plunker? I believe I need the same functionality.

@courtneyfaulkner
Copy link

I spent some time today researching how to set up ui-bootstrap triggers to respond to custom events for my project, so I threw what I found into a plunker: http://plnkr.co/edit/0wEqzz?p=preview . In my case, I needed to be able to trigger a popup on element A when hovering the mouse over element B.

@tplorts
Copy link

tplorts commented Jun 25, 2014

@courtneyfaulkner, that was super helpful to me, thanks very much!

@olgakostrub
Copy link

@courtneyfaulkner, you are a wizard! thank you so much for putting your effort into that plunker, it is extremely helpful) thanks a bunch!

@courtneyfaulkner
Copy link

Happy to help. :)

@MigCoder
Copy link

MigCoder commented Aug 2, 2014

@courtneyfaulkner perfect demo :)

@Elijen
Copy link

Elijen commented Oct 13, 2014

@courtneyfaulkner Is it actually necessary to name also the default triggers? I think the given object is extending the default one. So this should work:

$tooltipProvider.setTriggers({'customEvent': 'customEvent'});

@courtneyfaulkner
Copy link

@Elijen No, it's not necessary. The default trigger map

{
    'mouseenter': 'mouseleave',
    'click': 'click',
    'focus': 'blur'
}

will be extended with the attributes in .setTriggers().

@MattSidor
Copy link

@courtneyfaulkner Thank you so much for the Plunkr demo, very helpful to us Angular n00bs

@VictorCoding
Copy link

@courtneyfaulkner thanks alot! great plnkr. In my case i had to trigger the popover to close when selecting an item inside the popover.

@thotty
Copy link

thotty commented Sep 4, 2015

Thx, @courtneyfaulkner.
😄

@courtneyfaulkner
Copy link

I'm happy I could help. :)

@cyrilgandon
Copy link

The plunler is broken with the 0.13.4 release of the 3 september 2015.

Use popover-is-open instead

http://plnkr.co/edit/dm408dUoFKRVQKE9SOTb?p=preview

@courtneyfaulkner
Copy link

Ah, interesting. I was reading your issue #4364, @cyrilgandon, and spent some time with uib 0.14.1 in plunkr. I was able to get a custom event to fire the uib-tooltip once by using $('#tooltipTarget')[0].dispatchEvent(new Event('customEvent'));, which is not intuitive, and also fails to work on subsequent mouseovers. Per #4364, it seems they're still trying to fix their handling of custom events. 0.14.1 seems to be handling tooltip-is-open functionality pretty well, but in 0.13.4, I'm seeing bad tooltip positioning problems. I updated my http://plnkr.co/edit/0wEqzz?p=preview plunkr to be similar to yours, to avoid confusion for people coming across this thread. If/when they fix custom events, I may update my plunkr again.

@DzmVasileusky
Copy link

DzmVasileusky commented Jul 18, 2017

@courtneyfaulkner
toolip-is-open approach isn't stable with tooltip-popup-delay. I can't find a way to clear a delay timeout without custom triggers. So the tooltip showing after a delay no matter if you set open to false.

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

No branches or pull requests