RED-4819: Update scrollableParentView only when helpModeKey changes

This commit is contained in:
Nicoleta Panaghiu 2022-08-29 13:01:21 +03:00
parent 5263a1c40c
commit 7b27273d96

View File

@ -23,6 +23,7 @@ export class ExpandableFileActionsComponent implements OnChanges {
displayedButtons: Action[];
hiddenButtons: Action[];
expanded = false;
scrollableParentView: ScrollableParentView;
constructor(
private readonly _fileDownloadService: FileDownloadService,
@ -30,10 +31,6 @@ export class ExpandableFileActionsComponent implements OnChanges {
private readonly _permissionsService: PermissionsService,
) {}
get scrollableParentView(): ScrollableParentView {
return this.helpModeKey === 'document_features_in_dossier' ? ScrollableParentViews.VIRTUAL_SCROLL : undefined;
}
ngOnChanges(changes: SimpleChanges) {
if (changes.actions || changes.maxWidth || changes.minWidth) {
let count = 0;
@ -69,6 +66,11 @@ export class ExpandableFileActionsComponent implements OnChanges {
downloadBtn.disabled = !this._permissionsService.canDownloadFiles(downloadBtn.files, downloadBtn.dossier);
}
}
if (changes.helpModeKey) {
this.scrollableParentView =
this.helpModeKey === 'document_features_in_dossier' ? ScrollableParentViews.VIRTUAL_SCROLL : undefined;
}
}
private async _downloadFiles($event: MouseEvent, files: File[]) {