Chat-Page: Archivieren-Button durch 3-Dot-Menü ersetzt
This commit is contained in:
1 parent
aa2d9f1200
commit
a927d6da33
5 files changed
+90
-12
No files matched your search
@@ -93,9 +93,25 @@ registerPage('chat', {
|
||||
});
|
||||
}
|
||||
|
||||
// Header-Menü (3-Dot)
|
||||
const chatMenuBtn = document.getElementById('chatMenuBtn');
|
||||
const chatMenuDropdown = document.getElementById('chatMenuDropdown');
|
||||
if (chatMenuBtn && chatMenuDropdown) {
|
||||
chatMenuBtn.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
chatMenuDropdown.hidden = !chatMenuDropdown.hidden;
|
||||
});
|
||||
document.addEventListener('click', this._closeMenu = () => {
|
||||
chatMenuDropdown.hidden = true;
|
||||
});
|
||||
}
|
||||
|
||||
// Archivieren
|
||||
const archiveBtn = document.getElementById('archiveBtn');
|
||||
if (archiveBtn) archiveBtn.addEventListener('click', clearChat);
|
||||
if (archiveBtn) archiveBtn.addEventListener('click', () => {
|
||||
if (chatMenuDropdown) chatMenuDropdown.hidden = true;
|
||||
clearChat();
|
||||
});
|
||||
|
||||
// State zurücksetzen und History laden
|
||||
messages.length = 0;
|
||||
@@ -107,6 +123,10 @@ registerPage('chat', {
|
||||
},
|
||||
|
||||
destroy() {
|
||||
if (this._closeMenu) {
|
||||
document.removeEventListener('click', this._closeMenu);
|
||||
this._closeMenu = null;
|
||||
}
|
||||
stopHistoryPolling();
|
||||
messages.length = 0;
|
||||
lastKnownMessageId = 0;
|
||||
|
||||
Reference in new issue
Block a user