fix
This commit is contained in:
+7
-6
@@ -4,7 +4,7 @@
|
||||
<div class="chat-input-container mb-5">
|
||||
<div class="textarea-wrapper">
|
||||
<textarea {% if not IsLogin or not HaveKey %}disabled{% endif %} class="textarea"
|
||||
placeholder="Type your message here..." name="message" oninput="toggleSendButton(this)"
|
||||
placeholder="Type your message here..." name="message" oninput="toggleSendButton()"
|
||||
id="chat-input-textarea"></textarea>
|
||||
<div class="button-group">
|
||||
<hx hx-get="/loadSettings" hx-trigger="load" hx-swap="outerHTML" hx-target="this"></hx>
|
||||
@@ -37,18 +37,19 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const textarea = document.querySelector('.textarea');
|
||||
const textarea = document.querySelector('#chat-input-textarea');
|
||||
textarea.addEventListener('keydown', handleTextareaKeydown);
|
||||
|
||||
function toggleSendButton(textarea) {
|
||||
var sendButton = document.getElementById('chat-input-send-btn');
|
||||
sendButton.disabled = textarea.value.trim() === '';
|
||||
function toggleSendButton() {
|
||||
const sendButton = document.getElementById('chat-input-send-btn');
|
||||
const selectedLLMIds = JSON.parse(getSelectedModelsIDs());
|
||||
sendButton.disabled = textarea.value.trim() === '' || selectedLLMIds.length === 0;
|
||||
}
|
||||
|
||||
function clearTextArea() {
|
||||
setTimeout(function () {
|
||||
textarea.value = '';
|
||||
toggleSendButton(textarea);
|
||||
toggleSendButton();
|
||||
}, 200);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user