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

OnLoad event is limiting the app #10

Open
gustavopi opened this issue Jan 24, 2022 · 0 comments
Open

OnLoad event is limiting the app #10

gustavopi opened this issue Jan 24, 2022 · 0 comments

Comments

@gustavopi
Copy link

Hi! I am trying to include this widget in my site. However, it will auto launch by the onload function at the end, means all must be already loaded in the document.

document.body.onload = function () {
    var chatSelector = document.querySelectorAll(SELECTOR_CHAT_WIDGET);

    for (var i = 0; i < chatSelector.length; i++) {
      var element = chatSelector[i];
      var data = new Chat(element, {}, []); // eslint-disable-line no-unused-vars
    }
  };

But in many cases the html loaded is just the skeleton, there is a lot to loaded yet. In my case, I wish to put the toggle button in the "Search" menu that is loaded after, so the class won't find the button.
Is there a way to avoid this limitation?

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

1 participant