expandAll & collapseAll is modified

This commit is contained in:
병준 박 2019-11-18 16:28:47 +09:00
parent 4627e918ec
commit 686c859e74

View File

@ -15,7 +15,7 @@ import {
import { ucapAnimations } from '@ucap-webmessenger/ui'; import { ucapAnimations } from '@ucap-webmessenger/ui';
import { GroupDetailData, UserInfo } from '@ucap-webmessenger/protocol-sync'; import { GroupDetailData, UserInfo } from '@ucap-webmessenger/protocol-sync';
import { MatAccordion, MatTreeFlattener } from '@angular/material'; import { MatAccordion, MatTreeFlattener, MatTree } from '@angular/material';
import { ExpansionPanelItemDirective } from '../directives/expansion-panel-item.directive'; import { ExpansionPanelItemDirective } from '../directives/expansion-panel-item.directive';
import { import {
UserInfoSS, UserInfoSS,
@ -155,7 +155,8 @@ export class ExpansionPanelComponent
}) })
expansionPanelItemTemplateRef: TemplateRef<ExpansionPanelItemDirective>; expansionPanelItemTemplateRef: TemplateRef<ExpansionPanelItemDirective>;
@ViewChild('groupAccordion', { static: true }) groupAccordion: MatAccordion; @ViewChild('groupTree', { static: false })
groupTree: MatTree<FlatNode>;
@ViewChild('cvsvGroup', { static: false }) @ViewChild('cvsvGroup', { static: false })
cvsvGroup: CdkVirtualScrollViewport; cvsvGroup: CdkVirtualScrollViewport;
@ -226,11 +227,11 @@ export class ExpansionPanelComponent
isHeader = (_: number, node: FlatNode) => 0 === node.level; isHeader = (_: number, node: FlatNode) => 0 === node.level;
expandMore() { expandMore() {
this.groupAccordion.openAll(); this.groupTree.treeControl.expandAll();
} }
expandLess() { expandLess() {
this.groupAccordion.closeAll(); this.groupTree.treeControl.collapseAll();
} }
onClickMore(event: MouseEvent, group: GroupDetailData) { onClickMore(event: MouseEvent, group: GroupDetailData) {