Skip to content

Tooltip template updating and tooltip-append-to-body #155

Open
@doctornick42

Description

@doctornick42

Hi! First, thanks for this lib!

I have a problem with updating template if tooltip-append-to-body attribute is set to 'true'.

I use tooltip to show an information that comes from $http.get(). When tooltip is opened the response is not available yet. If tooltip-append-to-body is false, then everything's fine - my Angular controller get server's response, update its scope and I can see this info in the tooltip.

But, if tooltip-append-to-body is true, then after I get the response then tooltip is just closing.
I tried to debug it a bit and found out that after template is modified in my controller then onTooltipTemplateChange event is fired and then this event calls onTooltipShow().
Inside onTooltipShow:

 if ($attrs.tooltipAppendToBody) {
      ...
      removeAppendedTip(tooltipElement); 

And after that the tooltip is closed.

I think it can be caused by that: after this lines inside onTooltipShow there's this code:

if (event && $attrs.tooltipHidden !== 'true') {
    exradicatedTipElement.addClass('_exradicated-tooltip');
    angular.element(window.document.body).append(exradicatedTipElement);
}

If i get the idea right, this code tries to create a copy of the closed tooltip. But unfortunately event variable here is undefined

I'm not sure that I made everything right and even understand everything right but I really stuck with it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions