This commit is contained in:
Lost Paul 2024-09-17 17:16:45 +02:00
parent 15ac351344
commit 4b5168d3a0
5 changed files with 8 additions and 5 deletions

View file

@ -1,7 +1,7 @@
{
"id": "folder-notes",
"name": "Folder notes",
"version": "1.7.30-4-beta",
"version": "1.7.30-5-beta",
"minAppVersion": "0.15.0",
"description": "Create notes within folders that can be accessed without collapsing the folder, similar to the functionality offered in Notion.",
"author": "Lost Paul",

View file

@ -13,7 +13,7 @@ export class FileSuggest extends TextInputSuggest<TFile> {
public inputEl: HTMLInputElement,
plugin: FolderNotesPlugin
) {
super(inputEl);
super(inputEl, plugin);
}

View file

@ -14,7 +14,7 @@ export class FolderSuggest extends TextInputSuggest<TFolder> {
plugin: FolderNotesPlugin,
public folder?: TFolder,
) {
super(inputEl);
super(inputEl, plugin);
}

View file

@ -121,8 +121,9 @@ export abstract class TextInputSuggest<T> implements ISuggestOwner<T> {
private suggest: Suggest<T>;
plugin: FolderNotesPlugin;
constructor(inputEl: HTMLInputElement | HTMLTextAreaElement) {
constructor(inputEl: HTMLInputElement | HTMLTextAreaElement, plugin: FolderNotesPlugin) {
this.inputEl = inputEl;
this.plugin = plugin;
this.scope = new Scope();
this.suggestEl = createDiv('suggestion-container');

View file

@ -14,7 +14,7 @@ export class TemplateSuggest extends TextInputSuggest<TFile> {
public inputEl: HTMLInputElement,
plugin: FolderNotesPlugin
) {
super(inputEl);
super(inputEl, plugin);
}
@ -28,6 +28,7 @@ export class TemplateSuggest extends TextInputSuggest<TFile> {
}
getSuggestions(input_str: string): TFile[] {
console.log('this.plugin', this.plugin)
const { templateFolder, templaterPlugin } = getTemplatePlugins(this.plugin.app);
if ((!templateFolder || templateFolder?.trim() === '') && !templaterPlugin) {
this.plugin.settings.templatePath = '';
@ -39,6 +40,7 @@ export class TemplateSuggest extends TextInputSuggest<TFile> {
folder = this.plugin.app.vault.getAbstractFileByPath(templaterPlugin.plugin?.settings?.templates_folder as string) as TFolder;
} else {
console.log('templateFolder', templateFolder);
folder = this.plugin.app.vault.getAbstractFileByPath(templateFolder) as TFolder;
}