mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge pull request #3004 from joenunezb/enhancement-make-buttons-scrollable
Enhancement: Make buttons scrollable
This commit is contained in:
@ -2083,7 +2083,10 @@ async function buttonsCallback(args, text) {
|
||||
let popup;
|
||||
|
||||
const buttonContainer = document.createElement('div');
|
||||
buttonContainer.classList.add('flex-container', 'flexFlowColumn', 'wide100p', 'm-t-1');
|
||||
buttonContainer.classList.add('flex-container', 'flexFlowColumn', 'wide100p');
|
||||
|
||||
const scrollableContainer = document.createElement('div');
|
||||
scrollableContainer.classList.add('scrollable-buttons-container');
|
||||
|
||||
for (const [result, button] of resultToButtonMap) {
|
||||
const buttonElement = document.createElement('div');
|
||||
@ -2096,9 +2099,16 @@ async function buttonsCallback(args, text) {
|
||||
buttonContainer.appendChild(buttonElement);
|
||||
}
|
||||
|
||||
scrollableContainer.appendChild(buttonContainer);
|
||||
|
||||
const popupContainer = document.createElement('div');
|
||||
popupContainer.innerHTML = safeValue;
|
||||
popupContainer.appendChild(buttonContainer);
|
||||
popupContainer.appendChild(scrollableContainer);
|
||||
|
||||
// Ensure the popup uses flex layout
|
||||
popupContainer.style.display = 'flex';
|
||||
popupContainer.style.flexDirection = 'column';
|
||||
popupContainer.style.maxHeight = '80vh'; // Limit the overall height of the popup
|
||||
|
||||
popup = new Popup(popupContainer, POPUP_TYPE.TEXT, '', { okButton: 'Cancel', allowVerticalScrolling: true });
|
||||
popup.show()
|
||||
|
Reference in New Issue
Block a user