pool
pool copied to clipboard
Create jQuery instance at first time only
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.