#8 - Added some classes for easy customization
This commit is contained in:
@@ -1,17 +1,14 @@
|
|||||||
.osresult__title {
|
.omnisearch-modal {
|
||||||
|
}
|
||||||
|
|
||||||
|
.omnisearch-result {
|
||||||
|
}
|
||||||
|
|
||||||
|
.omnisearch-result__title {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.osresult__name {
|
.omnisearch-result__body {
|
||||||
padding-right: .5em;
|
|
||||||
font-size: small;
|
|
||||||
font-weight: normal;
|
|
||||||
color: var(--text-normal);
|
|
||||||
/* color: var(--text-muted);
|
|
||||||
text-decoration: underline; */
|
|
||||||
}
|
|
||||||
|
|
||||||
.osresult__body {
|
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
font-size: small;
|
font-size: small;
|
||||||
word-wrap: normal;
|
word-wrap: normal;
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ export class OmnisearchModal extends SuggestModal<ResultNote> {
|
|||||||
super(plugin.app)
|
super(plugin.app)
|
||||||
this.plugin = plugin
|
this.plugin = plugin
|
||||||
|
|
||||||
|
this.modalEl.addClass('omnisearch-modal')
|
||||||
|
|
||||||
this.setPlaceholder('Type to search through your notes')
|
this.setPlaceholder('Type to search through your notes')
|
||||||
|
|
||||||
this.setInstructions([
|
this.setInstructions([
|
||||||
@@ -137,13 +139,14 @@ export class OmnisearchModal extends SuggestModal<ResultNote> {
|
|||||||
|
|
||||||
renderSuggestion(value: ResultNote, el: HTMLElement): void {
|
renderSuggestion(value: ResultNote, el: HTMLElement): void {
|
||||||
el.setAttribute('data-note-id', value.path)
|
el.setAttribute('data-note-id', value.path)
|
||||||
|
el.addClass('omnisearch-result')
|
||||||
|
|
||||||
// title
|
// title
|
||||||
const title = el.createEl('div', { cls: 'osresult__title' })
|
const title = el.createEl('div', { cls: 'omnisearch-result__title' })
|
||||||
title.innerHTML = value.basename
|
title.innerHTML = value.basename
|
||||||
|
|
||||||
// body
|
// body
|
||||||
const body = el.createEl('div', { cls: 'osresult__body' })
|
const body = el.createEl('div', { cls: 'omnisearch-result__body' })
|
||||||
body.innerHTML = value.content
|
body.innerHTML = value.content
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user