let maxItems only if !this._pagination (#4079)

This commit is contained in:
Nicolas Barithel
2018-12-13 17:48:22 +01:00
committed by Eugenio Romano
parent 411166605e
commit 96ddd4210c

View File

@@ -295,23 +295,16 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
}
get pagination(): BehaviorSubject<PaginationModel> {
let maxItems = this.preferences.paginationSize;
if (!this._pagination) {
if (this.maxItems) {
maxItems = this.maxItems;
}
let maxItems = this.maxItems || this.preferences.paginationSize;
let defaultPagination = <PaginationModel> {
maxItems: maxItems,
skipCount: 0,
totalItems: 0,
hasMoreItems: false
};
this._pagination = new BehaviorSubject<PaginationModel>(defaultPagination);
}
return this._pagination;
}