mirror of
https://github.com/lostpaul/obsidian-folder-notes.git
synced 2026-07-22 07:40:24 +00:00
Make it possible to use folder overview plugin at the same time
This commit is contained in:
parent
1e4ed4b102
commit
a44cba7ef8
3 changed files with 12 additions and 9 deletions
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"id": "folder-notes",
|
||||
"name": "Folder notes",
|
||||
"version": "1.7.32",
|
||||
"version": "1.7.33",
|
||||
"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",
|
||||
|
|
|
|||
|
|
@ -140,8 +140,8 @@ export async function createFolderNote(plugin: FolderNotesPlugin, folderPath: st
|
|||
|
||||
const folder = plugin.app.vault.getAbstractFileByPath(folderPath);
|
||||
if (!(folder instanceof TFolder)) return;
|
||||
addCSSClassToTitleEL(plugin, path, 'is-folder-note', true);
|
||||
addCSSClassToTitleEL(plugin, folder.path, 'has-folder-note');
|
||||
addCSSClassToTitleEL(path, 'is-folder-note', true);
|
||||
addCSSClassToTitleEL(folder.path, 'has-folder-note');
|
||||
}
|
||||
|
||||
export async function turnIntoFolderNote(plugin: FolderNotesPlugin, file: TFile, folder: TFolder, folderNote?: TFile | null | TAbstractFile, skipConfirmation?: boolean) {
|
||||
|
|
@ -186,8 +186,8 @@ export async function turnIntoFolderNote(plugin: FolderNotesPlugin, file: TFile,
|
|||
}
|
||||
|
||||
await plugin.app.fileManager.renameFile(file, path);
|
||||
addCSSClassToTitleEL(plugin, path, 'is-folder-note', true);
|
||||
addCSSClassToTitleEL(plugin, folder.path, 'has-folder-note');
|
||||
addCSSClassToTitleEL(path, 'is-folder-note', true);
|
||||
addCSSClassToTitleEL(folder.path, 'has-folder-note');
|
||||
|
||||
if (plugin.activeFolderDom) {
|
||||
plugin.activeFolderDom.removeClass('fn-is-active');
|
||||
|
|
|
|||
11
src/main.ts
11
src/main.ts
|
|
@ -118,9 +118,12 @@ export default class FolderNotesPlugin extends Plugin {
|
|||
handleDelete(file, this);
|
||||
}));
|
||||
|
||||
this.registerMarkdownCodeBlockProcessor('folder-overview', (source: string, el: HTMLElement, ctx: MarkdownPostProcessorContext) => {
|
||||
this.handleOverviewBlock(source, el, ctx);
|
||||
});
|
||||
const folderOverviewEnabled = this.app.plugins.getPlugin('folder-overview')
|
||||
if (!folderOverviewEnabled) {
|
||||
this.registerMarkdownCodeBlockProcessor('folder-overview', (source: string, el: HTMLElement, ctx: MarkdownPostProcessorContext) => {
|
||||
this.handleOverviewBlock(source, el, ctx);
|
||||
});
|
||||
}
|
||||
|
||||
if (this.app.workspace.layoutReady) {
|
||||
// loadFileClasses(undefined, this);
|
||||
|
|
@ -155,7 +158,7 @@ export default class FolderNotesPlugin extends Plugin {
|
|||
// @ts-ignore
|
||||
const editMode = view.editMode ?? view.sourceMode ?? this.app.workspace.activeEditor?.editMode;
|
||||
if (!editMode) { return; }
|
||||
|
||||
|
||||
// console.log('editMode', editMode);
|
||||
const plugin = this;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue