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

Create jQuery instance at first time only #143

Open
mookjp opened this issue Feb 5, 2015 · 0 comments
Open

Create jQuery instance at first time only #143

mookjp opened this issue Feb 5, 2015 · 0 comments
Labels

Comments

@mookjp
Copy link
Owner

mookjp commented Feb 5, 2015

https://github.com/mookjp/pool/blob/master/docker/pool/build-screen/app/scripts/main.js#L1-L16

(function () {
    showCommitId();
    var es = new EventSource("/build/" + getCommitId());
    es.addEventListener("build_log", function(event){
        $(".log-console").append("\n" + event.data);
        $(".log-console").animate(
            { scrollTop:
                $(".log-console")[0].scrollHeight - $(".log-console").height()
            },
            50);
    });

    es.addEventListener("build_finished", function(event){
    document.location.reload();
    });
})();

As $(".log-console") was created every time in call of event, it may make client slow.

@mookjp mookjp added the MID label Feb 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant