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

modified init to be applied more than once #29

Closed
madebits opened this issue Dec 3, 2014 · 1 comment
Closed

modified init to be applied more than once #29

madebits opened this issue Dec 3, 2014 · 1 comment

Comments

@madebits
Copy link

madebits commented Dec 3, 2014

Hi,

I modified mermaid.init() so that it can be applied more than once. This is needed in my case to load content dynamically on the page. You may consider adding this minor change upstream.

var init = function () {
    var arr = document.querySelectorAll('.mermaid');

    var cnt = 0;
    for (i = 0; i < arr.length; i++) {
        var element = arr[i];

        // added code
        if(!element.getAttribute("data-processed")) {
            element.setAttribute("data-processed", true);
        } else continue;
...

Thanks, v

knsv added a commit that referenced this issue Dec 3, 2014
@knsv
Copy link
Collaborator

knsv commented Dec 3, 2014

Thanks for fix!

@knsv knsv closed this as completed Dec 3, 2014
mgenereu referenced this issue in mgenereu/mermaid Jun 25, 2022
Missing tooltip for chart shape when hover, it show out of screen due…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants