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,14 +8,16 @@
|
|||||||
(executeRowAction)="onExecuteRowAction($event)"
|
(executeRowAction)="onExecuteRowAction($event)"
|
||||||
(rowClick)="onRowClick($event)"
|
(rowClick)="onRowClick($event)"
|
||||||
(rowDblClick)="onRowDblClick($event)">
|
(rowDblClick)="onRowDblClick($event)">
|
||||||
<no-content-template>
|
<div *ngIf="!isEmptyTemplateDefined()">
|
||||||
<template>
|
<no-content-template>
|
||||||
<div class="document-list_empty_template">
|
<template>
|
||||||
<div class="document-list__this-space-is-empty">This folder is empty</div>
|
<div class="document-list_empty_template">
|
||||||
<div class="document-list__drag-drop">Drag and Drop</div>
|
<div class="document-list__this-space-is-empty">This folder is empty</div>
|
||||||
<div class="document-list__any-files-here-to-add">any files here to add</div>
|
<div class="document-list__drag-drop">Drag and Drop</div>
|
||||||
<img [src]="baseComponentPath + '/img/empty_doc_lib.svg'" class="document-list__empty_doc_lib">
|
<div class="document-list__any-files-here-to-add">any files here to add</div>
|
||||||
</div>
|
<img [src]="baseComponentPath + '/img/empty_doc_lib.svg'" class="document-list__empty_doc_lib">
|
||||||
</template>
|
</div>
|
||||||
</no-content-template>
|
</template>
|
||||||
|
</no-content-template>
|
||||||
|
</div>
|
||||||
</alfresco-datatable>
|
</alfresco-datatable>
|
||||||
|
@ -22,7 +22,6 @@ import {
|
|||||||
Output,
|
Output,
|
||||||
EventEmitter,
|
EventEmitter,
|
||||||
AfterContentInit,
|
AfterContentInit,
|
||||||
AfterViewInit,
|
|
||||||
AfterViewChecked,
|
AfterViewChecked,
|
||||||
TemplateRef,
|
TemplateRef,
|
||||||
NgZone,
|
NgZone,
|
||||||
@ -63,7 +62,7 @@ declare let __moduleName: string;
|
|||||||
providers: [DocumentListService],
|
providers: [DocumentListService],
|
||||||
directives: [CONTEXT_MENU_DIRECTIVES, ALFRESCO_DATATABLE_DIRECTIVES]
|
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 SINGLE_CLICK_NAVIGATION: string = 'click';
|
||||||
static DOUBLE_CLICK_NAVIGATION: string = 'dblclick';
|
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.dataTable) {
|
||||||
if (this.emptyFolderTemplate) {
|
if (this.emptyFolderTemplate) {
|
||||||
this.dataTable.noContentTemplate = this.emptyFolderTemplate;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterViewChecked() {
|
ngAfterViewChecked() {
|
||||||
|
@ -19,7 +19,6 @@ import {
|
|||||||
Directive,
|
Directive,
|
||||||
ContentChild,
|
ContentChild,
|
||||||
TemplateRef,
|
TemplateRef,
|
||||||
OnInit,
|
|
||||||
AfterContentInit
|
AfterContentInit
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { DocumentList } from './document-list';
|
import { DocumentList } from './document-list';
|
||||||
@ -27,19 +26,16 @@ import { DocumentList } from './document-list';
|
|||||||
@Directive({
|
@Directive({
|
||||||
selector: 'empty-folder-content'
|
selector: 'empty-folder-content'
|
||||||
})
|
})
|
||||||
export class EmptyFolderContent implements OnInit, AfterContentInit {
|
export class EmptyFolderContent implements AfterContentInit {
|
||||||
|
|
||||||
@ContentChild(TemplateRef)
|
@ContentChild(TemplateRef)
|
||||||
template: any;
|
template: any;
|
||||||
|
|
||||||
constructor(
|
constructor(private documentList: DocumentList) {
|
||||||
private documentList: DocumentList) {
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngAfterContentInit() {
|
ngAfterContentInit() {
|
||||||
this.documentList.emptyFolderTemplate = this.template;
|
this.documentList.emptyFolderTemplate = this.template;
|
||||||
|
this.documentList.dataTable.noContentTemplate = this.template;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user