mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-08 14:51:32 +00:00
[ADF-1623] routing integration for Viewer (#2404)
* routed viewer (demo app) * toolbar support * app menu component for demo shell * navigate back button * fix unit tests * improve viewer type detection and rendering * download button * automatic pdf rendition, spinners, ui tweaks * border for pdf pages * scroll top support * docs update * info drawer placeholder
This commit is contained in:
committed by
Maurizio Vitale
parent
55a999b492
commit
93a87af4a5
@@ -27,8 +27,6 @@ import {
|
||||
import { DataColumn, DataRow } from 'ng2-alfresco-datatable';
|
||||
import { DocumentListComponent, PermissionStyleModel } from 'ng2-alfresco-documentlist';
|
||||
|
||||
import { ViewerService } from 'ng2-alfresco-viewer';
|
||||
|
||||
const DEFAULT_FOLDER_TO_SHOW = '-my-';
|
||||
|
||||
@Component({
|
||||
@@ -46,8 +44,6 @@ export class FilesComponent implements OnInit {
|
||||
|
||||
toolbarColor = 'default';
|
||||
useDropdownBreadcrumb = false;
|
||||
useViewerDialog = true;
|
||||
useInlineViewer = false;
|
||||
|
||||
selectionModes = [
|
||||
{ value: 'none', viewValue: 'None' },
|
||||
@@ -91,27 +87,14 @@ export class FilesComponent implements OnInit {
|
||||
private contentService: AlfrescoContentService,
|
||||
private dialog: MdDialog,
|
||||
private translateService: AlfrescoTranslationService,
|
||||
private viewerService: ViewerService,
|
||||
private router: Router,
|
||||
@Optional() private route: ActivatedRoute) {
|
||||
}
|
||||
|
||||
showFile(event) {
|
||||
if (this.useViewerDialog) {
|
||||
if (event.value.entry.isFile) {
|
||||
this.viewerService
|
||||
.showViewerForNode(event.value.entry)
|
||||
.then(result => {
|
||||
console.log(result);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (event.value.entry.isFile) {
|
||||
this.fileNodeId = event.value.entry.id;
|
||||
this.showViewer = true;
|
||||
} else {
|
||||
this.showViewer = false;
|
||||
}
|
||||
const entry = event.value.entry;
|
||||
if (entry && entry.isFile) {
|
||||
this.router.navigate(['/files', entry.id, 'view']);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user