find widget refactoring to use note context

This commit is contained in:
zadam
2022-05-17 23:53:35 +02:00
parent 4978a3ff1a
commit cd622cbdd7
9 changed files with 62 additions and 41 deletions

View File

@@ -226,6 +226,21 @@ class NoteContext extends Component {
&& this.note.mime !== 'text/x-sqlite;schema=trilium'
&& !this.note.hasLabel('hideChildrenOverview');
}
async getTextEditor(callback) {
return new Promise(resolve => appContext.triggerCommand('executeInTextEditor', {
callback,
resolve,
ntxId: this.ntxId
}));
}
async getCodeEditor() {
return new Promise(resolve => appContext.triggerCommand('executeInCodeEditor', {
resolve,
ntxId: this.ntxId
}));
}
}
export default NoteContext;