From 188b6e98232da2443b8a4f902b813278e3a1064f Mon Sep 17 00:00:00 2001 From: leejinho Date: Thu, 21 Nov 2019 14:51:00 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B7=B8=EB=A3=B9=20>=20=ED=8E=BC=EC=B3=90?= =?UTF-8?q?=EB=86=93=EA=B3=A0=20=EA=B7=B8=EB=A3=B9=EB=A9=A4=EB=B2=84=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=EC=8B=9C=20=EC=A0=91=ED=9E=88=EB=A9=B4?= =?UTF-8?q?=EC=84=9C=20=EC=8A=A4=ED=81=AC=EB=A1=A4=EC=9D=B4=20=ED=95=98?= =?UTF-8?q?=EB=8B=A8=EC=97=90=20=EC=9C=A0=EC=A7=80=EB=90=98=EB=8A=94=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C.=20=20=20=20>=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?=ED=9B=84=20scroll=20top=EC=9C=BC=EB=A1=9C.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/lib/components/expansion-panel.component.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.ts b/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.ts index 4d2382c6..8c4f1aef 100644 --- a/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.ts +++ b/projects/ucap-webmessenger-ui-group/src/lib/components/expansion-panel.component.ts @@ -26,6 +26,7 @@ import { NGXLogger } from 'ngx-logger'; import { VirtualScrollTreeFlatDataSource } from '@ucap-webmessenger/ui'; import { FlatTreeControl } from '@angular/cdk/tree'; import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling'; +import { PerfectScrollbarDirective } from 'ngx-perfect-scrollbar'; enum NodeType { None = 'None', @@ -116,6 +117,10 @@ export class ExpansionPanelComponent children: [] }; + item.buddyList.sort((a, b) => + a.name < b.name ? -1 : a.name > b.name ? 1 : 0 + ); + item.buddyList.forEach(userInfo => { groupNode.children.push({ nodeType: NodeType.Buddy, @@ -160,6 +165,9 @@ export class ExpansionPanelComponent @ViewChild('cvsvGroup', { static: false }) cvsvGroup: CdkVirtualScrollViewport; + @ViewChild('cvsvGroup', { read: PerfectScrollbarDirective, static: false }) + perfectScrollbar: PerfectScrollbarDirective; + NodeType = NodeType; profileNodes: GroupNode[] = []; @@ -270,5 +278,9 @@ export class ExpansionPanelComponent ...this.buddyNodes ]; this.dataSource.data = this.rootNodeList; + + if (!!this.perfectScrollbar) { + this.perfectScrollbar.scrollToTop(); + } } }