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> { get pagination(): BehaviorSubject<PaginationModel> {
let maxItems = this.preferences.paginationSize;
if (!this._pagination) { if (!this._pagination) {
if (this.maxItems) { let maxItems = this.maxItems || this.preferences.paginationSize;
maxItems = this.maxItems;
}
let defaultPagination = <PaginationModel> { let defaultPagination = <PaginationModel> {
maxItems: maxItems, maxItems: maxItems,
skipCount: 0, skipCount: 0,
totalItems: 0, totalItems: 0,
hasMoreItems: false hasMoreItems: false
}; };
this._pagination = new BehaviorSubject<PaginationModel>(defaultPagination); this._pagination = new BehaviorSubject<PaginationModel>(defaultPagination);
} }
return this._pagination; return this._pagination;
} }