Dynamically update show more title

155172a2b45a660822aa01e7aa69cd8e2f209a04

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +6 -1Ignore whitespace
public/scripts/templates/welcomePanel.html+1 -1
@@ -73,7 +73,7 @@
7373 {{/with}}
7474 {{/each}}
7575 {{#if more}}
76- <button class="menu_button menu_button_icon showMoreChats" data-i18n="[title]Show more recent chats" title="Show more recent chats">
76+ <button class="menu_button menu_button_icon showMoreChats">
7777 <small class="fa-solid fa-chevron-down fa-fw fa-1x"></small>
7878 </button>
7979 {{/if}}
public/scripts/welcome-screen.js+5 -0
@@ -135,12 +135,17 @@ async function sendWelcomePanel() {
135135 });
136136 const hiddenChats = fragment.querySelectorAll('.recentChat.hidden');
137137 fragment.querySelectorAll('button.showMoreChats').forEach((button) => {
138+ const showRecentChatsTitle = t`Show more recent chats`;
139+ const hideRecentChatsTitle = t`Show less recent chats`;
140+
141+ button.setAttribute('title', showRecentChatsTitle);
138142 button.addEventListener('click', () => {
139143 const rotate = button.classList.contains('rotated');
140144 hiddenChats.forEach((chatItem) => {
141145 chatItem.classList.toggle('hidden', rotate);
142146 });
143147 button.classList.toggle('rotated', !rotate);
148+ button.setAttribute('title', rotate ? showRecentChatsTitle : hideRecentChatsTitle);
144149 });
145150 });
146151 fragment.querySelectorAll('button.openTemporaryChat').forEach((button) => {