diff --git a/src/app/components/nodes/markdown/markdown.component.ts b/src/app/components/nodes/markdown/markdown.component.ts index 758ceae..c81adf3 100644 --- a/src/app/components/nodes/markdown/markdown.component.ts +++ b/src/app/components/nodes/markdown/markdown.component.ts @@ -54,7 +54,7 @@ export class MarkdownComponent extends EditorNodeContract implements OnInit { } public writeChangesToNode(): void | Promise { - 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; diff --git a/src/app/components/search/Search.component.scss b/src/app/components/search/Search.component.scss index b2d1742..adf0171 100644 --- a/src/app/components/search/Search.component.scss +++ b/src/app/components/search/Search.component.scss @@ -42,6 +42,12 @@ color: var(--noded-background-files); } } + + &.markdown { + .search-icon { + color: var(--noded-background-markdown); + } + } } .search-assoc { diff --git a/src/app/components/search/Search.component.ts b/src/app/components/search/Search.component.ts index 8999fa4..0bc03ae 100644 --- a/src/app/components/search/Search.component.ts +++ b/src/app/components/search/Search.component.ts @@ -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(); }