Add a "Show controls" button to chat UI (#3590)

This commit is contained in:
oobabooga 2023-08-16 02:39:58 -03:00 committed by GitHub
parent 32ff3da941
commit 2a29208224
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 66 additions and 16 deletions

18
js/show_controls.js Normal file
View file

@ -0,0 +1,18 @@
const belowChatInput = document.querySelectorAll("#chat-tab > div > :nth-child(n+3), #extensions");
const chatParent = document.getElementById("chat").parentNode;
function toggle_controls(value) {
if (value) {
belowChatInput.forEach(element => {
element.style.display = "inherit";
});
chatParent.classList.remove("bigchat");
} else {
belowChatInput.forEach(element => {
element.style.display = "none";
});
chatParent.classList.add("bigchat");
}
}