Files and search component fix with routing support (#2191)

This commit is contained in:
Popovics András
2017-08-09 18:32:23 +01:00
committed by Mario Romano
parent 5ad4fe171a
commit e6ae21a0bc
7 changed files with 42 additions and 12 deletions

View File

@@ -1,6 +1,8 @@
<div class="search-results-container">
<h1>Search results</h1>
<alfresco-search (preview)="showFile($event)"></alfresco-search>
<alfresco-search
[navigate]="false"
(nodeDbClick)="nodeDbClick($event)"></alfresco-search>
</div>
<div *ngIf="fileShowed">

View File

@@ -52,9 +52,17 @@ export class SearchComponent {
constructor(public router: Router) {
}
showFile(event) {
if (event.value.entry.isFile) {
this.fileNodeId = event.value.entry.id;
nodeDbClick($event: any) {
if ($event.value.entry.isFolder) {
this.router.navigate(['/files', $event.value.entry.id]);
} else {
this.showFile($event);
}
}
showFile($event) {
if ($event.value.entry.isFile) {
this.fileNodeId = $event.value.entry.id;
this.fileShowed = true;
} else {
this.fileShowed = false;