#581 fix document list data loading

- reduce amount of unnecessary data reloads
This commit is contained in:
Denys Vuika
2016-08-19 10:40:50 +01:00
parent cb5cac2cbc
commit 48edbea8ae
2 changed files with 1 additions and 14 deletions

View File

@@ -24,7 +24,6 @@ import {
AfterContentInit,
AfterViewInit,
AfterViewChecked,
OnChanges,
TemplateRef,
NgZone,
ViewChild,
@@ -59,7 +58,7 @@ declare let __moduleName: string;
providers: [DocumentListService],
directives: [CONTEXT_MENU_DIRECTIVES, ALFRESCO_DATATABLE_DIRECTIVES]
})
export class DocumentList implements OnInit, AfterViewInit, AfterViewChecked, AfterContentInit, OnChanges {
export class DocumentList implements OnInit, AfterViewInit, AfterViewChecked, AfterContentInit {
static SINGLE_CLICK_NAVIGATION: string = 'click';
static DOUBLE_CLICK_NAVIGATION: string = 'dblclick';
@@ -165,14 +164,9 @@ export class DocumentList implements OnInit, AfterViewInit, AfterViewChecked, Af
ngOnInit() {
this.data.thumbnails = this.thumbnails;
this.data.maxItems = this.pageSize;
this.displayFolderContent(this.currentFolderPath);
this.contextActionHandler.subscribe(val => this.contextActionCallback(val));
}
ngOnChanges() {
this.reload();
}
ngAfterContentInit() {
let columns = this.data.getColumns();
if (!columns || columns.length === 0) {
@@ -185,7 +179,6 @@ export class DocumentList implements OnInit, AfterViewInit, AfterViewChecked, Af
if (this.emptyFolderTemplate) {
this.dataTable.noContentTemplate = this.emptyFolderTemplate;
}
}
}