Multi-File Upload, Dateinamen in History, kein Auto-Scroll bei Attachment-Klick

This commit is contained in:
Meleki committed 2026-02-27 08:28:59 +01:00
1 parent 0b2c9a08c6
commit 663f2c2a9a
7 files changed
+66 -40

No files matched your search

+8 -3
View File
@@ -124,15 +124,21 @@ function removeStreamedElements() {
// ── Attachment Indicator ──
function addAttachmentIndicator(messageId, count) {
function addAttachmentIndicator(messageId, count, namesJson) {
const chat = chatEl();
const lastMsg = chat.lastElementChild;
if (!lastMsg) return;
let names = [];
try { if (namesJson) names = JSON.parse(namesJson); } catch {}
const indicator = document.createElement('div');
indicator.className = 'attachment-indicator';
indicator.textContent = `📎 ${count} Datei${count > 1 ? 'en' : ''}`;
const nameList = names.filter(n => n).join(', ');
indicator.textContent = `📎 ${count} Datei${count > 1 ? 'en' : ''}` + (nameList ? `: ${nameList}` : '');
indicator.style.cursor = 'pointer';
indicator.title = 'Klicken zum Anzeigen';
indicator.addEventListener('click', () => loadAndShowAttachments(messageId, indicator));
lastMsg.appendChild(indicator);
}
@@ -168,7 +174,6 @@ async function loadAndShowAttachments(messageId, indicator) {
indicator.textContent = `📎 ${attachments.length} Datei${attachments.length > 1 ? 'en' : ''}`;
indicator.parentElement.appendChild(container);
scrollDown();
} catch (e) {
indicator.textContent = '📎 Fehler beim Laden';
indicator.dataset.loaded = '';