mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2025-03-12 23:07:20 +08:00
Fixed some chat stuff
This commit is contained in:
parent
74e6ffd6c3
commit
68ba12414f
@ -130,20 +130,15 @@ window.APP = {
|
|||||||
input.style.height = `${input.scrollHeight + 2}px`;
|
input.style.height = `${input.scrollHeight + 2}px`;
|
||||||
},
|
},
|
||||||
send(e) {
|
send(e) {
|
||||||
if (e.shiftKey) {
|
if(this.message !== '') {
|
||||||
this.message += '\n';
|
post('http://chat/chatResult', JSON.stringify({
|
||||||
this.resize();
|
message: this.message,
|
||||||
|
}));
|
||||||
|
this.oldMessages.unshift(this.message);
|
||||||
|
this.oldMessagesIndex = -1;
|
||||||
|
this.hideInput();
|
||||||
} else {
|
} else {
|
||||||
if(this.message !== '') {
|
this.hideInput(true);
|
||||||
post('http://chat/chatResult', JSON.stringify({
|
|
||||||
message: this.message,
|
|
||||||
}));
|
|
||||||
this.oldMessages.unshift(this.message);
|
|
||||||
this.oldMessagesIndex = -1;
|
|
||||||
this.hideInput();
|
|
||||||
} else {
|
|
||||||
this.hideInput(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
hideInput(canceled = false) {
|
hideInput(canceled = false) {
|
||||||
|
@ -83,6 +83,10 @@ textarea {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
textarea:focus, input:focus {
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
.msg {
|
.msg {
|
||||||
margin-bottom: 3px;
|
margin-bottom: 3px;
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
ref="input"
|
ref="input"
|
||||||
type="text"
|
type="text"
|
||||||
autofocus
|
autofocus
|
||||||
|
spellcheck="false"
|
||||||
@keyup.esc="hideInput"
|
@keyup.esc="hideInput"
|
||||||
@keyup="keyUp"
|
@keyup="keyUp"
|
||||||
@keydown="keyDown"
|
@keydown="keyDown"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user