pool icon indicating copy to clipboard operation
pool copied to clipboard

Create jQuery instance at first time only

Open mookjp opened this issue 11 years ago • 0 comments

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 avatar Feb 05 '15 13:02 mookjp