From 52c4fb75ff74b5bfde60e0d16c445a1c3b8d3950 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Fri, 15 Sep 2023 20:56:30 -0700 Subject: [PATCH] Remove extra space in --chat-buttons --- js/main.js | 4 +++- js/show_controls.js | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/js/main.js b/js/main.js index f7f97af7..5f926485 100644 --- a/js/main.js +++ b/js/main.js @@ -216,6 +216,8 @@ for(i = 0; i < textareaElements.length; i++) { //------------------------------------------------ // Improve the looks of the chat input field //------------------------------------------------ +let isOld = document.querySelectorAll('.old-ui').length > 0; + document.getElementById('chat-input').parentNode.style.background = 'transparent'; document.getElementById('chat-input').parentNode.style.border = 'none'; document.getElementById('chat-input').parentElement.parentElement.style.minWidth = 0; @@ -224,7 +226,7 @@ document.getElementById('stop').parentElement.parentElement.style.minWidth = 0; document.getElementById('stop').parentElement.parentElement.style.display = 'flex'; document.getElementById('stop').parentElement.parentElement.style.flexDirection = 'column-reverse'; document.getElementById('stop').parentElement.parentElement.style.paddingBottom = '3px'; -document.getElementById('stop').parentElement.parentElement.parentElement.style.paddingBottom = '20px'; +document.getElementById('stop').parentElement.parentElement.parentElement.style.paddingBottom = isOld ? '0px' : '20px'; document.getElementById('stop').parentElement.parentElement.style.flex = '0 0 auto'; diff --git a/js/show_controls.js b/js/show_controls.js index 31d377da..96a511c1 100644 --- a/js/show_controls.js +++ b/js/show_controls.js @@ -1,5 +1,6 @@ const belowChatInput = document.querySelectorAll("#chat-tab > div > :nth-child(n+2), #extensions"); const chatParent = document.querySelector(".chat-parent"); +let isOld = document.querySelectorAll('.old-ui').length > 0; function toggle_controls(value) { if (value) { @@ -8,7 +9,7 @@ function toggle_controls(value) { }); chatParent.classList.remove("bigchat"); - document.getElementById('stop').parentElement.parentElement.parentElement.style.paddingBottom = '20px'; + document.getElementById('stop').parentElement.parentElement.parentElement.style.paddingBottom = isOld ? '0px' : '20px'; document.getElementById('show-controls').parentNode.parentNode.style.paddingBottom = '115px'; } else { belowChatInput.forEach(element => {