text-generation-webui/js/show_controls.js
2023-09-14 07:06:42 -03:00

23 lines
978 B
JavaScript

const belowChatInput = document.querySelectorAll("#chat-tab > div > :nth-child(n+2), #extensions");
const chatParent = document.getElementById("chat").parentNode.parentNode.parentNode;
function toggle_controls(value) {
if (value) {
belowChatInput.forEach(element => {
element.style.display = "inherit";
});
chatParent.classList.remove("bigchat");
document.getElementById('stop').parentElement.parentElement.parentElement.style.paddingBottom = '20px';
document.getElementById('show-controls').parentNode.parentNode.style.paddingBottom = '115px';
} else {
belowChatInput.forEach(element => {
element.style.display = "none";
});
chatParent.classList.add("bigchat");
document.getElementById('stop').parentElement.parentElement.parentElement.style.paddingBottom = '0px';
document.getElementById('show-controls').parentNode.parentNode.style.paddingBottom = '95px';
}
}