mirror of
https://github.com/go-gitea/gitea
synced 2025-07-04 17:47:19 +00:00
support the open-icon of folder (#34168)
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@ -13,7 +13,7 @@ export type DiffTreeEntry = {
|
||||
EntryMode: string,
|
||||
IsViewed: boolean,
|
||||
Children: DiffTreeEntry[],
|
||||
|
||||
FileIcon: string,
|
||||
ParentEntry?: DiffTreeEntry,
|
||||
}
|
||||
|
||||
@ -22,6 +22,8 @@ type DiffFileTreeData = {
|
||||
};
|
||||
|
||||
type DiffFileTree = {
|
||||
folderIcon: string;
|
||||
folderOpenIcon: string;
|
||||
diffFileTree: DiffFileTreeData;
|
||||
fullNameMap?: Record<string, DiffTreeEntry>
|
||||
fileTreeIsVisible: boolean;
|
||||
@ -31,7 +33,7 @@ type DiffFileTree = {
|
||||
let diffTreeStoreReactive: Reactive<DiffFileTree>;
|
||||
export function diffTreeStore() {
|
||||
if (!diffTreeStoreReactive) {
|
||||
diffTreeStoreReactive = reactiveDiffTreeStore(pageData.DiffFileTree);
|
||||
diffTreeStoreReactive = reactiveDiffTreeStore(pageData.DiffFileTree, pageData.FolderIcon, pageData.FolderOpenIcon);
|
||||
}
|
||||
return diffTreeStoreReactive;
|
||||
}
|
||||
@ -55,9 +57,11 @@ function fillFullNameMap(map: Record<string, DiffTreeEntry>, entry: DiffTreeEntr
|
||||
}
|
||||
}
|
||||
|
||||
export function reactiveDiffTreeStore(data: DiffFileTreeData): Reactive<DiffFileTree> {
|
||||
export function reactiveDiffTreeStore(data: DiffFileTreeData, folderIcon: string, folderOpenIcon: string): Reactive<DiffFileTree> {
|
||||
const store = reactive({
|
||||
diffFileTree: data,
|
||||
folderIcon,
|
||||
folderOpenIcon,
|
||||
fileTreeIsVisible: false,
|
||||
selectedItem: '',
|
||||
fullNameMap: {},
|
||||
|
Reference in New Issue
Block a user