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

client site's onload call back getting knocked off #56

Closed
tapsey opened this issue Jul 12, 2017 · 1 comment
Closed

client site's onload call back getting knocked off #56

tapsey opened this issue Jul 12, 2017 · 1 comment

Comments

@tapsey
Copy link
Contributor

tapsey commented Jul 12, 2017

Implementing websites' onload callback not called. Issue is caused by :

window.onload = function () { getmdlSelect.init('.getmdl-select'); document.addEventListener("DOMNodeInserted", function (ev) { if (ev.relatedNode.querySelectorAll(".getmdl-select").length > 0) { componentHandler.upgradeDom(); } }, false); };

You can use

window.addEventListener ? window.addEventListener("load",mWhenLoaded,false) : window.attachEvent && window.attachEvent("onload",mWhenLoaded);

function mWhenLoaded() {
    getmdlSelect.init('.getmdl-select');
    document.addEventListener("DOMNodeInserted", function (ev) {
        if (ev.relatedNode.querySelectorAll(".getmdl-select").length > 0) {
            componentHandler.upgradeDom();
        }
    }, false);
};`
@JeckPikachan
Copy link
Contributor

Thank you for this issue. Merged your pull request.

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