From 68ba12414f79409f3a60c05f49fdc03367e20f69 Mon Sep 17 00:00:00 2001 From: Jonas Dellinger Date: Mon, 26 Jun 2017 16:23:57 +0200 Subject: [PATCH] Fixed some chat stuff --- resources/[system]/chat/html/App.js | 21 ++++++++------------- resources/[system]/chat/html/index.css | 4 ++++ resources/[system]/chat/html/index.html | 1 + 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/resources/[system]/chat/html/App.js b/resources/[system]/chat/html/App.js index ff9d89b..3fcd3a0 100644 --- a/resources/[system]/chat/html/App.js +++ b/resources/[system]/chat/html/App.js @@ -130,20 +130,15 @@ window.APP = { input.style.height = `${input.scrollHeight + 2}px`; }, send(e) { - if (e.shiftKey) { - this.message += '\n'; - this.resize(); + if(this.message !== '') { + post('http://chat/chatResult', JSON.stringify({ + message: this.message, + })); + this.oldMessages.unshift(this.message); + this.oldMessagesIndex = -1; + this.hideInput(); } else { - if(this.message !== '') { - post('http://chat/chatResult', JSON.stringify({ - message: this.message, - })); - this.oldMessages.unshift(this.message); - this.oldMessagesIndex = -1; - this.hideInput(); - } else { - this.hideInput(true); - } + this.hideInput(true); } }, hideInput(canceled = false) { diff --git a/resources/[system]/chat/html/index.css b/resources/[system]/chat/html/index.css index dedb895..a44c51b 100644 --- a/resources/[system]/chat/html/index.css +++ b/resources/[system]/chat/html/index.css @@ -83,6 +83,10 @@ textarea { overflow: hidden; } +textarea:focus, input:focus { + outline: none; +} + .msg { margin-bottom: 3px; } diff --git a/resources/[system]/chat/html/index.html b/resources/[system]/chat/html/index.html index 64ee96e..a0c43b2 100644 --- a/resources/[system]/chat/html/index.html +++ b/resources/[system]/chat/html/index.html @@ -37,6 +37,7 @@ ref="input" type="text" autofocus + spellcheck="false" @keyup.esc="hideInput" @keyup="keyUp" @keydown="keyDown"