text-generation-webui/js/show_controls.js

31 lines
1.0 KiB
JavaScript
Raw Normal View History

const belowChatInput = document.querySelectorAll("#chat-tab > div > :nth-child(n+2), #extensions");
const chatParent = document.querySelector(".chat-parent");
function toggle_controls(value) {
2023-10-07 22:07:57 -04:00
if (value) {
belowChatInput.forEach(element => {
element.style.display = "inherit";
});
2023-10-07 22:07:57 -04:00
chatParent.classList.remove("bigchat");
document.getElementById("chat-input-row").classList.remove("bigchat");
document.getElementById("chat-col").classList.remove("bigchat");
document.getElementById("chat-tab").style.paddingBottom = "";
2023-11-19 11:31:01 -05:00
2023-12-27 12:59:23 -05:00
let gallery_element = document.getElementById("gallery-extension");
2023-11-19 11:31:01 -05:00
if (gallery_element) {
2023-12-27 12:59:23 -05:00
gallery_element.style.display = "block";
2023-11-19 11:31:01 -05:00
}
2023-10-07 22:07:57 -04:00
} else {
belowChatInput.forEach(element => {
element.style.display = "none";
});
2023-10-07 22:07:57 -04:00
chatParent.classList.add("bigchat");
document.getElementById("chat-input-row").classList.add("bigchat");
document.getElementById("chat-col").classList.add("bigchat");
document.getElementById("chat-tab").style.paddingBottom = "0px";
2023-10-07 22:07:57 -04:00
}
}