Markdown show up in full-text search results
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing

This commit is contained in:
Garrett Mills 2020-10-16 12:31:26 -05:00
parent 0d329ac18a
commit 6c3ebfe36d
Signed by: garrettmills
GPG Key ID: D2BF5FBA8298F246
3 changed files with 12 additions and 11 deletions

View File

@ -54,7 +54,7 @@ export class MarkdownComponent extends EditorNodeContract implements OnInit {
}
public writeChangesToNode(): void | Promise<void> {
this.node.Value.Mode = 'code';
this.node.Value.Mode = 'markdown';
this.node.Value.Value = this.contents;
this.node.value = this.contents;
this.savedValue = this.contents;

View File

@ -42,6 +42,12 @@
color: var(--noded-background-files);
}
}
&.markdown {
.search-icon {
color: var(--noded-background-markdown);
}
}
}
.search-assoc {

View File

@ -59,19 +59,14 @@ export class SearchComponent implements OnInit {
}
async openResult(result: SearchResult) {
const nodeTypes = [
'node', 'code', 'db', 'files', 'markdown',
];
if ( result.type === 'page' ) {
await this.router.navigate(['/editor', { id: result.id }]);
await this.dismiss();
} 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();
} else if ( result.type === 'db' ) {
await this.router.navigate(['/editor', { id: result.associated.id, node_id: result.id }]);
await this.dismiss();
} else if ( result.type === 'files' ) {
} else if ( nodeTypes.includes(result.type) ) {
await this.router.navigate(['/editor', { id: result.associated.id, node_id: result.id }]);
await this.dismiss();
}