pagination fixes (#2448)

This commit is contained in:
Denys Vuika
2017-10-06 20:51:43 +01:00
committed by Eugenio Romano
parent 70182c53aa
commit 31c3a5339a
2 changed files with 8 additions and 0 deletions

View File

@@ -981,4 +981,11 @@ describe('DocumentList', () => {
expect(documentList.resetPagination).toHaveBeenCalledTimes(2);
});
it('should reset folder node upon changing current folder id', () => {
documentList.folderNode = <any> {};
documentList.ngOnChanges({currentFolderId: new SimpleChange(null, '-sites-', false)});
expect(documentList.folderNode).toBeNull();
});
});

View File

@@ -244,6 +244,7 @@ export class DocumentListComponent implements OnInit, OnChanges, AfterContentIni
} else if (changes.currentFolderId && changes.currentFolderId.currentValue) {
if (changes.currentFolderId.previousValue !== changes.currentFolderId.currentValue) {
this.resetPagination();
this.folderNode = null;
}
if (!this.hasCustomLayout) {
this.setupDefaultColumns(changes.currentFolderId.currentValue);