el includes subfolders. selfEL only holds that items div

This commit is contained in:
Callum Loh 2023-04-09 16:34:01 +01:00
parent dac170fc1c
commit 89ab22d51f
2 changed files with 2 additions and 2 deletions

2
src/globals.d.ts vendored
View file

@ -21,7 +21,7 @@ interface FileExplorerWorkspaceLeaf extends WorkspaceLeaf {
interface FileExplorerViewFileItem extends TAbstractFile {
titleEl: HTMLElement
el: HTMLElement
selfEl: HTMLElement
}
interface FileExplorerView extends View {

View file

@ -297,7 +297,7 @@ export default class FolderNotesPlugin extends Plugin {
if(!fileExplorer) { return null; }
const fileExplorerItem = fileExplorer.view.fileItems[path];
if(!fileExplorerItem) { return null; }
if(fileExplorerItem.el) return fileExplorerItem.el;
if(fileExplorerItem.selfEl) return fileExplorerItem.selfEl;
return fileExplorerItem.titleEl;
}