diff --git a/webpack/vue/auth/channel.vue b/webpack/vue/auth/channel.vue index a04cc48..7f5d2cb 100644 --- a/webpack/vue/auth/channel.vue +++ b/webpack/vue/auth/channel.vue @@ -22,7 +22,7 @@
- +
@@ -44,6 +44,10 @@ export default { }; }, + beforeMount(){ + console.warn('beforeMount'); + }, + methods: { /* (1) Auto-grow text area @@ -70,23 +74,6 @@ export default { // register pressed keys this.pressed[e.keyCode] = true; - // if not ENTER OR SHIFT -> do nothing - if( e.keyCode !== 13 || this.pressed[16] ) - return; - - - - // bufferize message + remove trailing line - let buffer = e.target.value.replace(/\n*$/, ''); - this.message = buffer; - - // send message - if( !gs.get.content.send_message(buffer) ) - return; - - // empty message - this.message = ''; - }, @@ -98,6 +85,21 @@ export default { // unregister pressed keys this.pressed[e.keyCode] = false; + // if not ENTER OR SHIFT -> do nothing + if( e.keyCode !== 13 || this.pressed[16] ) + return; + + // bufferize message + remove trailing line + this.message = this.message.replace(/\n*$/, ''); + + // send message + if( !gs.get.content.send_message(this.message) ) + return; + + // empty message + this.message = ''; + this.auto_grow(e); + } },