[ADF-2393] fixed reloading on delete with infinite scrolling (#3057)

* [ADF-2393] fixed reloading on delete with infinite scrolling

* [ADF-2393] refactored after PR
This commit is contained in:
Vito
2018-03-13 17:28:25 +00:00
committed by Eugenio Romano
parent 27de866193
commit 766bb082f5
3 changed files with 11 additions and 21 deletions

View File

@@ -295,7 +295,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
}
emitReadyEvent(event: any) {
if (this.pageIsEmpty(event)) {
if (this.standardPagination && this.pageIsEmpty(event)) {
this.standardPagination.goPrevious();
} else {
this.documentListReady.emit(event);
@@ -328,11 +328,20 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
onContentActionSuccess(message) {
const translatedMessage: any = this.translateService.get(message);
this.notificationService.openSnackMessage(translatedMessage.value, 4000);
this.reloadForInfiniteScrolling();
}
onDeleteActionSuccess(message) {
this.uploadService.fileDeleted.next(message);
this.deleteElementSuccess.emit();
this.reloadForInfiniteScrolling();
}
private reloadForInfiniteScrolling() {
if (this.infiniteScrolling) {
this.documentList.skipCount = 0;
this.documentList.reload();
}
}
onManageVersions(event) {