parent
e18122c67d
commit
9f4008c2a2
|
@ -1,5 +1,4 @@
|
||||||
import {
|
import {
|
||||||
FileExplorerView,
|
|
||||||
FrontMatterCache,
|
FrontMatterCache,
|
||||||
MetadataCache,
|
MetadataCache,
|
||||||
Plugin,
|
Plugin,
|
||||||
|
@ -685,7 +684,8 @@ export const determineBookmarksOrderIfNeeded = (folderItems: Array<FolderItemFor
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const folderSort = function (sortingSpec: CustomSortSpec, ctx: ProcessingContext, fileExplorer: FileExplorerView) {
|
export const folderSort = function (sortingSpec: CustomSortSpec, ctx: ProcessingContext) {
|
||||||
|
let fileExplorer = this.fileExplorer
|
||||||
|
|
||||||
// shallow copy of groups and expand folder-specific macros on them
|
// shallow copy of groups and expand folder-specific macros on them
|
||||||
sortingSpec.groupsShadow = sortingSpec.groups?.map((group) => Object.assign({} as CustomSortGroup, group))
|
sortingSpec.groupsShadow = sortingSpec.groups?.map((group) => Object.assign({} as CustomSortGroup, group))
|
||||||
|
|
|
@ -622,7 +622,7 @@ export default class CustomSortPlugin extends Plugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sortSpec) {
|
if (sortSpec) {
|
||||||
return folderSort.call(this, sortSpec, plugin.createProcessingContextForSorting(has), patchableFileExplorer);
|
return folderSort.call(this, sortSpec, plugin.createProcessingContextForSorting(has));
|
||||||
} else {
|
} else {
|
||||||
return old.call(this, ...args);
|
return old.call(this, ...args);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ declare module 'obsidian' {
|
||||||
|
|
||||||
export interface FileExplorerView extends View {
|
export interface FileExplorerView extends View {
|
||||||
createFolderDom(folder: TFolder): FileExplorerFolder;
|
createFolderDom(folder: TFolder): FileExplorerFolder;
|
||||||
fileItems: any;
|
|
||||||
requestSort(): void;
|
requestSort(): void;
|
||||||
|
|
||||||
sortOrder: string
|
sortOrder: string
|
||||||
|
|
Loading…
Reference in New Issue