mirror of
https://github.com/DJ2LS/FreeDATA
synced 2024-05-14 08:04:33 +00:00
Allow pressing enter to send chat messages.
This commit is contained in:
parent
8cba7b6486
commit
59fb66dc0b
1 changed files with 9 additions and 4 deletions
|
@ -38,12 +38,14 @@ import {
|
|||
import { Line } from 'vue-chartjs'
|
||||
import { ref, computed } from 'vue';
|
||||
|
||||
|
||||
const chatModuleMessage=ref(null);
|
||||
|
||||
|
||||
function transmitNewMessage(){
|
||||
|
||||
|
||||
chat.inputText = chat.inputText.trim();
|
||||
if (chat.inputText.length==0)
|
||||
return;
|
||||
if (chat.selectedCallsign.startsWith("BC-")) {
|
||||
|
||||
newBroadcast(chat.selectedCallsign, chat.inputText)
|
||||
|
@ -52,7 +54,9 @@ function transmitNewMessage(){
|
|||
newMessage(chat.selectedCallsign, chat.inputText, chat.inputFile, chat.inputFileName, chat.inputFileSize, chat.inputFileType)
|
||||
}
|
||||
// finally do a cleanup
|
||||
chat.inputText = ''
|
||||
//chatModuleMessage.reset();
|
||||
chat.inputText = '';
|
||||
chatModuleMessage.value="";
|
||||
// @ts-expect-error
|
||||
resetFile()
|
||||
}
|
||||
|
@ -183,9 +187,10 @@ const speedChartData = computed(() => ({
|
|||
<textarea
|
||||
class="form-control"
|
||||
rows="1"
|
||||
id="chatModuleMessage"
|
||||
ref="chatModuleMessage"
|
||||
placeholder="Message - Send with [Enter]"
|
||||
v-model="chat.inputText"
|
||||
@keyup.enter.exact="transmitNewMessage()"
|
||||
></textarea>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue