viewer enhancements (#499)

* fix ngOnInit inheritance

* use unified info drawer
This commit is contained in:
Denys Vuika
2018-07-08 15:58:45 +01:00
committed by GitHub
parent 718a32a907
commit f503880f72
5 changed files with 20 additions and 52 deletions

View File

@@ -53,6 +53,7 @@ export abstract class PageComponent implements OnInit, OnDestroy {
displayMode = DisplayMode.List;
sharedPreviewUrl$: Observable<string>;
actions: Array<ContentActionExtension> = [];
canUpdateFile = false;
canDelete = false;
canEditFolder = false;
canUpload = false;
@@ -82,6 +83,7 @@ export abstract class PageComponent implements OnInit, OnDestroy {
this.infoDrawerOpened = false;
}
this.actions = this.extensions.getSelectedContentActions(selection, this.node);
this.canUpdateFile = this.selection.file && this.content.canUpdateNode(selection.file);
this.canDelete = !this.selection.isEmpty && this.content.canDeleteNodes(selection.nodes);
this.canEditFolder = selection.folder && this.content.canUpdateNode(selection.folder);
this.canDeleteShared = !this.selection.isEmpty && this.content.canDeleteSharedNodes(selection.nodes);