diff --git a/src/app/components/shared/comment-list/comment-list.component.html b/src/app/components/shared/comment-list/comment-list.component.html index bbce4fc1392c1de8202d8e44d4a7722180c3cf18..98e0004f6574adf2d5d8ac3733640d738a67560f 100644 --- a/src/app/components/shared/comment-list/comment-list.component.html +++ b/src/app/components/shared/comment-list/comment-list.component.html @@ -264,7 +264,7 @@ <app-mat-spinner-overlay *ngIf="isLoading" overlay="true"></app-mat-spinner-overlay> <div *ngIf="!isLoading"> - <app-comment *ngFor="let current of hideCommentsList ? filteredComments : commentsFilteredByTime; let i = index" + <app-comment *ngFor="let current of (hideCommentsList ? filteredComments : commentsFilteredByTime).slice(page*5,(page*5)+5); let i = index" [appScrollIntoView]="current.id === focusCommentId" [usesJoyride]="i === 0 && isJoyrideActive" [comment]="current" @@ -279,6 +279,10 @@ (clickedOnKeyword)="clickedOnKeyword($event)" (votedComment)="votedComment($event)"> </app-comment> + <mat-paginator [pageSize]="5" (page)="setPage($event)" + [length]="(hideCommentsList ? filteredComments : commentsFilteredByTime).length"></mat-paginator> + <ars-row [height]="64"> + </ars-row> </div> <!-- Active User Overlay --> diff --git a/src/app/components/shared/comment-list/comment-list.component.ts b/src/app/components/shared/comment-list/comment-list.component.ts index 94e0bebd71b7be2c35bbb73938a2c8daeeff8fcc..111c8d64c83cbf8a2166de2e746333688ce9dce2 100644 --- a/src/app/components/shared/comment-list/comment-list.component.ts +++ b/src/app/components/shared/comment-list/comment-list.component.ts @@ -109,6 +109,7 @@ export class CommentListComponent implements OnInit, OnDestroy { private _subscriptionEventServiceTagConfig = null; private _subscriptionEventServiceRoomData = null; private _subscriptionRoomService = null; + page=0; constructor( private commentService: CommentService, @@ -141,6 +142,10 @@ export class CommentListComponent implements OnInit, OnDestroy { }); } + setPage(e:any){ + this.page=e.pageIndex; + } + initNavigation() { this._subscriptionEventServiceTagConfig = this.eventService.on<string>('setTagConfig').subscribe(tag => { this.setTimePeriod(Period.all);