-
Notifications
You must be signed in to change notification settings - Fork 6.7k
[popover/tooltip] Support Programmatic Triggers #590
Comments
Make Let people set the value in addition to read from it. |
Thinking about dialogs / tooltips / popovers - maybe it would be a good idea to have a $tooltip / $popover service (as we've got the $dialog one) so people can trigger popovers / tooltips as they like. Basically give people a way to control popovers / tooltips programatically. WDYT? |
I think tool tips are far too contextual to the DOM to be triggered purely
|
I agree with @ProLoser - for example using a popover to indicate invalid content entered into a form field - if the field was marked as invalid, the popover would display, disappearing when valid input was entered. |
Just wanted to connect this issue to: I think there is a use case for showing only one popover at a time (using tooltips with mouseenter and mouseleave is not touch friendly and would not work well on tablets). Opening a single popover and dismissing it by touching/clicking elsewhere in the body would work well for tablets and phones. I have posted some code at 618 which can be used to accomplish this. Cheers. |
Has this been addressed with the $tooltipService? I see a mention on the docs, but it's usage isn't clear to me. |
|
Any progress on this one ? |
Also interested in this, any progress? |
Has anyone got solution for this? |
This is how I'm implementing triggers for popovers : Gist. Basically it overwrites the original popover with a new function. This method is called monkey patching. |
Here is a stackoverflow question I asked about this issue: |
Did the team agree on a solution for this? I think making isOpen two-way binding and adding an onTrigger/onToggle callback, similarly to what's being done for the dropdown component in #1616, would be a good solution. I can submit a pull request if no one else is working on it. |
👍 |
Two way binding to show/hide would be great! |
+1 |
This seems to be very demanded feature. Can you guys @pkozlowski-opensource @ProLoser let us know how should this be solved so somebody can create a PR? I am not sure what happened with @luthur's original PR. |
Meanwhile I created a Bower package including |
Thank you for your effort @Elijen! Unfortunately your directive seems to lack the same feature I described earlier, when trying to add the toggle to a popover-template. Do you have a solution for that? One week and nothing happend on this topic - sadly the maintainers do not really feel responsible to answer here. |
@krnlde That's strange, I think it should work with both |
@krnlde Seems to work for me:
Note that |
Ah I see. What I mean it is not working when putting the close trigger in the template for the popover itself - like we need this closing cross inside the angular.module("template/popover/popover.html", []).run(["$templateCache", function($templateCache) {
$templateCache.put("template/popover/popover.html",
"<div class=\"popover\"\n" +
" tooltip-animation-class=\"fade\"\n" +
" tooltip-classes\n" +
" ng-class=\"{ in: isOpen() }\">\n" +
" <div class=\"arrow\"></div>\n" +
"\n" +
" <div class=\"popover-inner\">\n" +
" <h3 class=\"popover-title\" ng-if=\"title\">{{title}} <button type=\"button\" class=\"close\" ng-click=\"isOpen != isOpen\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span></button></h3>\n" +
" <div class=\"popover-content\" ng-bind=\"content\"></div>\n" +
" </div>\n" +
"</div>\n" +
"");
}]); This is because the scope of the template is another than the one you put the toggle in and they don't inherit from each other (this is just a guess). |
@krnlde You should be to use Here is a plunkr: http://plnkr.co/edit/wIgZzH1Dw1Bm7QtZvZMn?p=preview |
Thanks for your plunkr, but it achieved a goal I'm not looking for. I need to add the close button inside the |
Do you guys have any news on that? |
👍 here. I don't understand why this is not already available ... |
@Elijen Pretty neat! 👍 |
Sweat! Thanks! |
I can't make it work though. :( I have cloned the repo and built it with Grunt (AFAIK official releases don't include the commit yet). It generated a But if I have
it doesn't work. Did I miss something? |
@aug-riedinger It's meant to bind to a property in your controller. |
Correct me if I'm wrong, but having At least that's how it works for every other directive I use. Besides, I tried setting the variable in the controller and it doesn't work either... Do you maybe have a working example available online? |
Cool it works! I get an error message though:
|
@aug-riedinger requests for support should go through the official, documented channels. Comments on closed issues are very easily lost. Here's your example: http://plnkr.co/edit/DMqpDWJyRgDRPRbYr1Mx. |
Remove duplicate file comment in select.css
This means one cant use arbitrary expressions as value for |
@RobJacobs thanks! :) |
The upstream JavaScript version supports
trigger="manual"
to allow for programmatic triggering.The text was updated successfully, but these errors were encountered: