perfect scrollbar of messeages is added
This commit is contained in:
parent
43d96eb477
commit
22605ae51e
|
@ -70,17 +70,19 @@
|
|||
<!-- Timer Room Info -->
|
||||
|
||||
<!-- CHAT MESSAGES -->
|
||||
<ucap-chat-messages
|
||||
[messages]="eventList$ | async"
|
||||
[userInfos]="userInfoList"
|
||||
[loginRes]="loginRes"
|
||||
[sessionVerInfo]="sessionVerInfo"
|
||||
(massDetail)="onMassDetail($event)"
|
||||
(save)="onSave($event)"
|
||||
(imageViewer)="onImageViewer($event)"
|
||||
(contextMenu)="onContextMenuMessage($event)"
|
||||
>
|
||||
</ucap-chat-messages>
|
||||
<perfect-scrollbar fxFlex="1 1 auto" #psChatContent>
|
||||
<ucap-chat-messages
|
||||
[messages]="eventList$ | async"
|
||||
[userInfos]="userInfoList"
|
||||
[loginRes]="loginRes"
|
||||
[sessionVerInfo]="sessionVerInfo"
|
||||
(massDetail)="onMassDetail($event)"
|
||||
(save)="onSave($event)"
|
||||
(imageViewer)="onImageViewer($event)"
|
||||
(contextMenu)="onContextMenuMessage($event)"
|
||||
>
|
||||
</ucap-chat-messages>
|
||||
</perfect-scrollbar>
|
||||
<!-- CHAT MESSAGES -->
|
||||
|
||||
<div
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
@charset 'utf-8';
|
||||
$line-basic:1px solid #dddddd;
|
||||
$line-basic: 1px solid #dddddd;
|
||||
@mixin ellipsis($row) {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
|
@ -28,9 +28,9 @@ $line-basic:1px solid #dddddd;
|
|||
height: 70px;
|
||||
min-height: 70px;
|
||||
border-bottom: $line-basic;
|
||||
background-color:#ffffff;
|
||||
.chat-header{
|
||||
width:100%;
|
||||
background-color: #ffffff;
|
||||
.chat-header {
|
||||
width: 100%;
|
||||
.responsive-chats-button {
|
||||
padding: 0;
|
||||
width: 40px;
|
||||
|
@ -42,14 +42,14 @@ $line-basic:1px solid #dddddd;
|
|||
font-weight: 100;
|
||||
line-height: 40px;
|
||||
}
|
||||
.room-name{
|
||||
font-size:16px;
|
||||
padding:0 10px;
|
||||
@include ellipsis(1)
|
||||
.room-name {
|
||||
font-size: 16px;
|
||||
padding: 0 10px;
|
||||
@include ellipsis(1);
|
||||
}
|
||||
.room-option{
|
||||
width:100px;
|
||||
margin-left:auto;
|
||||
.room-option {
|
||||
width: 100px;
|
||||
margin-left: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,6 +55,7 @@ import {
|
|||
ImageViewerDialogResult
|
||||
} from '@app/layouts/common/dialogs/image-viewer.dialog.component';
|
||||
import { Maximum_Range } from '@ucap-webmessenger/core';
|
||||
import { PerfectScrollbarComponent } from 'ngx-perfect-scrollbar';
|
||||
|
||||
@Component({
|
||||
selector: 'app-layout-messenger-messages',
|
||||
|
@ -70,6 +71,9 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewChecked {
|
|||
messageContextMenuTrigger: MatMenuTrigger;
|
||||
messageContextMenuPosition = { x: '0px', y: '0px' };
|
||||
|
||||
@ViewChild('psChatContent', { static: true })
|
||||
psChatContent: PerfectScrollbarComponent;
|
||||
|
||||
environmentsInfo: EnvironmentsInfo;
|
||||
|
||||
loginRes: LoginResponse;
|
||||
|
@ -143,7 +147,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewChecked {
|
|||
select(AppStore.MessengerSelector.EventSelector.selectAllInfoList)
|
||||
);
|
||||
|
||||
this.scrollToBottomForMessageBoxContainer();
|
||||
this.psChatContent.directiveRef.scrollToBottom(0, 0);
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
|
@ -159,7 +163,7 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewChecked {
|
|||
}
|
||||
|
||||
ngAfterViewChecked(): void {
|
||||
this.scrollToBottomForMessageBoxContainer();
|
||||
this.psChatContent.directiveRef.scrollToBottom(0, 0);
|
||||
}
|
||||
|
||||
getRoomName() {
|
||||
|
@ -220,12 +224,6 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewChecked {
|
|||
this.store.dispatch(RoomStore.updateOnlyAlarm({ roomInfo: this.roomInfo }));
|
||||
}
|
||||
|
||||
private scrollToBottomForMessageBoxContainer(): void {
|
||||
try {
|
||||
this.messageBoxContainer.nativeElement.scrollTop = this.messageBoxContainer.nativeElement.scrollHeight;
|
||||
} catch (err) {}
|
||||
}
|
||||
|
||||
/** MassText Detail View */
|
||||
onMassDetail(value: number) {
|
||||
this.store.dispatch(
|
||||
|
|
Loading…
Reference in New Issue
Block a user