Include code snippets in full-text search (#7)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
&.node {
|
||||
.search-icon {
|
||||
color: var(--noded-background-node);
|
||||
content: '\f10d';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +30,12 @@
|
||||
color: var(--noded-background-db);
|
||||
}
|
||||
}
|
||||
|
||||
&.code {
|
||||
.search-icon {
|
||||
color: var(--noded-background-code);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.search-assoc {
|
||||
|
||||
@@ -7,11 +7,11 @@ import {Router} from '@angular/router';
|
||||
export interface SearchResult {
|
||||
title: string;
|
||||
short_title: string;
|
||||
type: 'page' | 'node';
|
||||
type: 'page' | 'node' | 'code';
|
||||
id: string;
|
||||
associated?: {
|
||||
title: string,
|
||||
type: 'page' | 'node',
|
||||
type: 'page',
|
||||
id: string
|
||||
};
|
||||
}
|
||||
@@ -30,6 +30,7 @@ export class SearchComponent implements OnInit {
|
||||
node: 'fa fa-quote-left',
|
||||
page: 'fa fa-sticky-note',
|
||||
db: 'fa fa-database',
|
||||
code: 'fa fa-code',
|
||||
};
|
||||
|
||||
constructor(
|
||||
@@ -68,6 +69,9 @@ export class SearchComponent implements OnInit {
|
||||
} else if ( result.type === 'node' ) {
|
||||
await this.router.navigate(['/editor', { id: result.associated.id, node_id: result.id }]);
|
||||
await this.dismiss();
|
||||
} else if ( result.type === 'code' ) {
|
||||
await this.router.navigate(['/editor', { id: result.associated.id, node_id: result.id }]);
|
||||
await this.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user