accordeon_not_ok

This commit is contained in:
Pascal 2025-01-17 18:30:27 +01:00
parent ce25ecc237
commit 1cfaf5ab1b

View File

@ -721,6 +721,25 @@ class ChatElement extends HTMLElement {
li.appendChild(roleList); li.appendChild(roleList);
groupList.appendChild(li); groupList.appendChild(li);
container.addEventListener('click', (event) => {
event.stopPropagation();
container.classList.toggle('expanded');
const roleList = container.parentElement?.querySelector('.role-list');
const dm = container.parentElement?.querySelector('.dm');
if (roleList) {
// Si le container est expanded, on montre la liste des rôles
if (container.classList.contains('expanded')) {
(roleList as HTMLElement).style.display = 'block';
if (dm) (dm as HTMLElement).style.display = 'block';
} else {
// Sinon on cache la liste des rôles
(roleList as HTMLElement).style.display = 'none';
if (dm) (dm as HTMLElement).style.display = 'none';
}
}
});
} }
@ -925,7 +944,7 @@ class ChatElement extends HTMLElement {
if (this.processId) { if (this.processId) {
console.log('🔍 Loading chat with process ID:', this.processId); console.log('🔍 Loading chat with process ID:', this.processId);
this.loadGroupListFromAProcess(this.processId); this.loadGroupListFromAProcess(this.processId);
} else { } else if(this.processId == null){
console.error('❌ No process ID found in element attributes'); console.error('❌ No process ID found in element attributes');
this.loadAllGroupList(); this.loadAllGroupList();
} }