mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
add possible future configurability display mode document list and datatable (#2998)
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<adf-document-list
|
||||
[currentFolderId]="'-recent-'"
|
||||
locationFormat="/files"
|
||||
[cardview]="true"
|
||||
[display]="'gallery'"
|
||||
[showHeader]="false"
|
||||
[maxItems]="5"
|
||||
(preview)="showFile($event)"
|
||||
@@ -67,8 +67,9 @@
|
||||
<button
|
||||
mat-icon-button
|
||||
title="{{ 'DOCUMENT_LIST.TOOLBAR.CARDVIEW' | translate }}"
|
||||
(click)="toogleCardview()">
|
||||
<mat-icon>view_comfy</mat-icon>
|
||||
(click)="toogleGalleryView()">
|
||||
<mat-icon *ngIf="displayMode === 'list'" >view_comfy</mat-icon>
|
||||
<mat-icon *ngIf="displayMode === 'gallery'">list</mat-icon>
|
||||
</button>
|
||||
<button
|
||||
mat-icon-button
|
||||
@@ -130,8 +131,9 @@
|
||||
</button>
|
||||
<mat-menu #menu="matMenu">
|
||||
<button mat-menu-item
|
||||
(click)="toogleCardview()">
|
||||
<mat-icon>view_comfy</mat-icon>
|
||||
(click)="toogleGalleryView()">
|
||||
<mat-icon *ngIf="displayMode === 'list'" >view_comfy</mat-icon>
|
||||
<mat-icon *ngIf="displayMode === 'gallery'">list</mat-icon>
|
||||
<span>{{ 'DOCUMENT_LIST.TOOLBAR.CARDVIEW' | translate }}</span>
|
||||
</button>
|
||||
<button mat-menu-item
|
||||
@@ -171,7 +173,7 @@
|
||||
[allowDropFiles]="true"
|
||||
[selectionMode]="selectionMode"
|
||||
[multiselect]="multiselect"
|
||||
[cardview]="cardview"
|
||||
[display]="displayMode"
|
||||
[node]="nodeResult"
|
||||
(error)="onNavigationError($event)"
|
||||
(success)="resetError()"
|
||||
|
@@ -21,12 +21,19 @@ import {
|
||||
} from '@angular/core';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
||||
import { MinimalNodeEntity, NodePaging, Pagination, PathElementEntity, MinimalNodeEntryEntity, SiteEntry } from 'alfresco-js-api';
|
||||
import {
|
||||
MinimalNodeEntity,
|
||||
NodePaging,
|
||||
Pagination,
|
||||
PathElementEntity,
|
||||
MinimalNodeEntryEntity,
|
||||
SiteEntry
|
||||
} from 'alfresco-js-api';
|
||||
import {
|
||||
AuthenticationService, ContentService, TranslationService,
|
||||
FileUploadEvent, FolderCreatedEvent, LogService, NotificationService,
|
||||
UploadService, DataColumn, DataRow, UserPreferencesService,
|
||||
PaginationComponent, FormValues
|
||||
PaginationComponent, FormValues, DisplayMode
|
||||
} from '@alfresco/adf-core';
|
||||
|
||||
import { DocumentListComponent, PermissionStyleModel } from '@alfresco/adf-content-services';
|
||||
@@ -50,7 +57,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
fileNodeId: any;
|
||||
showViewer = false;
|
||||
showVersions = false;
|
||||
cardview = false;
|
||||
displayMode = DisplayMode.List;
|
||||
|
||||
toolbarColor = 'default';
|
||||
|
||||
@@ -441,7 +448,11 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
this.turnedPreviousPage.emit(event);
|
||||
}
|
||||
|
||||
toogleCardview(event: Pagination): void {
|
||||
this.cardview = !this.cardview;
|
||||
toogleGalleryView(): void {
|
||||
if (this.displayMode === DisplayMode.List) {
|
||||
this.displayMode = DisplayMode.Gallery;
|
||||
} else {
|
||||
this.displayMode = DisplayMode.List;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user