mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Files and search component fix with routing support (#2191)
This commit is contained in:
committed by
Mario Romano
parent
5ad4fe171a
commit
e6ae21a0bc
@@ -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">
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user