From 8a649dbf0b1a7c656014659421d5a1afec99364b Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 7 Dec 2017 20:11:28 +0100 Subject: [PATCH] upd: vue.container.inbox (fix submit trigger) --- view/vue/container/inbox.vue | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/view/vue/container/inbox.vue b/view/vue/container/inbox.vue index 21b7852..accf734 100644 --- a/view/vue/container/inbox.vue +++ b/view/vue/container/inbox.vue @@ -9,7 +9,7 @@
-
+
@@ -27,11 +27,19 @@ export default { methods: { new_message(msg){ - // {1} Send message // - this.gstore.func.sendMessage(this.gstore.new_msg.inbox, wsc_chat); + /* (1) If empty message -> abort */ + if( msg.trim().length == 0 ) + return; - // {2} Empty input // + /* (2) Send message to WebSocket */ + wsc_chat.send(JSON.stringify({message: msg})); + + /* (3) Add loader */ + gstore.data.msg_pending.inbox = true; + + /* (4) Empty input */ this.gstore.new_msg.inbox = ''; + }, bbcode: function(msg){