js/chatClient.js
/**
     * Setup events enterKey/click/esc
     */
Setup events enterKey/click/esc
Setup events enterKey / click / esc
eventSetup() {
        this.chatMsg.addEventListener('keydown', (key) => {
            key = key.which || key.keyCode;
            if (key === 13) {
                this.sendMessage();
            }
        });
        this.sendBtn.onclick = () => {
            this.sendMessage();
        };
        this.chatMsg.addEventListener('keyup', (key) => {
            key = key.which || key.keyCode;
            if (key === 27) {
                this.chatMsg.value = '';
            }
        });
    }
eventSetup ( ) { this . chatMsg . addEventListener ( 'keydown' , ( key ) => { key = key . which || key . keyCode ; if ( key === 13 ) { this . sendMessage ( ) ; } } ) ; this . sendBtn . onclick = ( ) => { this . sendMessage ( ) ; } ; this . chatMsg . addEventListener ( 'keyup' , ( key ) => { key = key . which || key . keyCode ; if ( key === 27 ) { this . chatMsg . value = '' ; } } ) ; }
Setup events enterKey/click/esc
Setup events enterKey / click / esc