mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
Merge pull request #703 from Alfresco/dev-mromano-702
#702 fix empty folder document list
This commit is contained in:
commit
28e0514935
@ -8,6 +8,7 @@
|
||||
(executeRowAction)="onExecuteRowAction($event)"
|
||||
(rowClick)="onRowClick($event)"
|
||||
(rowDblClick)="onRowDblClick($event)">
|
||||
<div *ngIf="!isEmptyTemplateDefined()">
|
||||
<no-content-template>
|
||||
<template>
|
||||
<div class="document-list_empty_template">
|
||||
@ -18,4 +19,5 @@
|
||||
</div>
|
||||
</template>
|
||||
</no-content-template>
|
||||
</div>
|
||||
</alfresco-datatable>
|
||||
|
@ -22,7 +22,6 @@ import {
|
||||
Output,
|
||||
EventEmitter,
|
||||
AfterContentInit,
|
||||
AfterViewInit,
|
||||
AfterViewChecked,
|
||||
TemplateRef,
|
||||
NgZone,
|
||||
@ -63,7 +62,7 @@ declare let __moduleName: string;
|
||||
providers: [DocumentListService],
|
||||
directives: [CONTEXT_MENU_DIRECTIVES, ALFRESCO_DATATABLE_DIRECTIVES]
|
||||
})
|
||||
export class DocumentList implements OnInit, AfterViewInit, AfterViewChecked, AfterContentInit {
|
||||
export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit {
|
||||
|
||||
static SINGLE_CLICK_NAVIGATION: string = 'click';
|
||||
static DOUBLE_CLICK_NAVIGATION: string = 'dblclick';
|
||||
@ -201,12 +200,13 @@ export class DocumentList implements OnInit, AfterViewInit, AfterViewChecked, Af
|
||||
}
|
||||
}
|
||||
|
||||
ngAfterViewInit() {
|
||||
isEmptyTemplateDefined() {
|
||||
if (this.dataTable) {
|
||||
if (this.emptyFolderTemplate) {
|
||||
this.dataTable.noContentTemplate = this.emptyFolderTemplate;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
ngAfterViewChecked() {
|
||||
|
@ -19,7 +19,6 @@ import {
|
||||
Directive,
|
||||
ContentChild,
|
||||
TemplateRef,
|
||||
OnInit,
|
||||
AfterContentInit
|
||||
} from '@angular/core';
|
||||
import { DocumentList } from './document-list';
|
||||
@ -27,19 +26,16 @@ import { DocumentList } from './document-list';
|
||||
@Directive({
|
||||
selector: 'empty-folder-content'
|
||||
})
|
||||
export class EmptyFolderContent implements OnInit, AfterContentInit {
|
||||
export class EmptyFolderContent implements AfterContentInit {
|
||||
|
||||
@ContentChild(TemplateRef)
|
||||
template: any;
|
||||
|
||||
constructor(
|
||||
private documentList: DocumentList) {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
constructor(private documentList: DocumentList) {
|
||||
}
|
||||
|
||||
ngAfterContentInit() {
|
||||
this.documentList.emptyFolderTemplate = this.template;
|
||||
this.documentList.dataTable.noContentTemplate = this.template;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user