mirror of
https://github.com/zadam/trilium.git
synced 2024-09-30 12:35:59 +08:00
42 lines
1 KiB
JavaScript
42 lines
1 KiB
JavaScript
|
import noteAutocompleteService from '../services/note_autocomplete.js';
|
||
|
import treeService from "./tree.js";
|
||
|
|
||
|
class NoteDetailEmpty {
|
||
|
/**
|
||
|
* @param {TabContext} ctx
|
||
|
*/
|
||
|
constructor(ctx) {
|
||
|
this.ctx = ctx;
|
||
|
this.$component = ctx.$tabContent.find('.note-detail-empty');
|
||
|
this.$autoComplete = ctx.$tabContent.find(".note-autocomplete");
|
||
|
}
|
||
|
|
||
|
render() {
|
||
|
this.$component.show();
|
||
|
this.ctx.$noteTitleRow.hide();
|
||
|
|
||
|
noteAutocompleteService.initNoteAutocomplete(this.$autoComplete, { hideGoToSelectedNoteButton: true })
|
||
|
.on('autocomplete:selected', function(event, suggestion, dataset) {
|
||
|
if (!suggestion.path) {
|
||
|
return false;
|
||
|
}
|
||
|
|
||
|
treeService.activateNote(suggestion.path);
|
||
|
});
|
||
|
|
||
|
noteAutocompleteService.showRecentNotes(this.$autoComplete);
|
||
|
this.$autoComplete.focus();
|
||
|
}
|
||
|
|
||
|
getContent() {}
|
||
|
|
||
|
focus() {}
|
||
|
|
||
|
onNoteChange() {}
|
||
|
|
||
|
cleanup() {}
|
||
|
|
||
|
scrollToTop() {}
|
||
|
}
|
||
|
|
||
|
export default NoteDetailEmpty;
|