Skip to content

Create jQuery instance at first time only #143

@mookjp

Description

@mookjp

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions