mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Dynamically update show more title
This commit is contained in:
@@ -135,12 +135,17 @@ async function sendWelcomePanel() {
|
||||
});
|
||||
const hiddenChats = fragment.querySelectorAll('.recentChat.hidden');
|
||||
fragment.querySelectorAll('button.showMoreChats').forEach((button) => {
|
||||
const showRecentChatsTitle = t`Show more recent chats`;
|
||||
const hideRecentChatsTitle = t`Show less recent chats`;
|
||||
|
||||
button.setAttribute('title', showRecentChatsTitle);
|
||||
button.addEventListener('click', () => {
|
||||
const rotate = button.classList.contains('rotated');
|
||||
hiddenChats.forEach((chatItem) => {
|
||||
chatItem.classList.toggle('hidden', rotate);
|
||||
});
|
||||
button.classList.toggle('rotated', !rotate);
|
||||
button.setAttribute('title', rotate ? showRecentChatsTitle : hideRecentChatsTitle);
|
||||
});
|
||||
});
|
||||
fragment.querySelectorAll('button.openTemporaryChat').forEach((button) => {
|
||||
|
Reference in New Issue
Block a user