Skip to content

Dynamic content #62

Closed
Closed
@Aspie96

Description

@Aspie96

Hi, still me.
I know it would require some major modifications, but is support for dynamic content planned to be implemented?

The code contains scripts like:

var Tooltips = document.querySelectorAll('[data-toggle=tooltip]'), i = 0, tpl = Tooltips.length;
for (i;i<tpl;i++){  
    var item = Tooltips[i], options = {};
    options.animation = item.getAttribute('data-animation');
    options.placement = item.getAttribute('data-placement');
    options.duration = item.getAttribute('data-duration');
    options.delay = item.getAttribute('data-delay');
    new Tooltip(item,options);
}

The problem with that is that it will not work with dinamically added content (which many sites use).

There are already some events attached to document, such as in:

document.addEventListener('click', this.close, false);

There should be only one event handler for clicks, attached to the document, so that it can work with dynamic content as well.

Although the code would need to be modified in different places, it should not be a big problem per se.
The problem is when there is a FOR cycle like the one I quoted before (which, of course, could not be done), but there should be some kind of work-around for each specific case.

Thank you very much in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions