@@ -3,22 +3,20 @@ import { ExplorerLeaf, ElementsObj, Pairs } from '../types/obsidian';
33
44export function newNavTreeStart ( plugin : Plugin ) {
55
6- // 1.get the elements in CLUSTER
6+ //: 1.get the elements in CLUSTER
77 const elements = getElementsObj ( plugin )
88 if ( ! elements ) {
99 return
1010 }
11- // 1 .extract/sort the pairs from elements
11+ //: 2 .extract/sort the pairs from elements
1212 const pairs = getPairs ( elements )
1313 if ( ! pairs ) {
1414 return
1515 }
16- // 3.edit the old navTree
16+ //: 3.edit the old navTree
1717 oldNavTreeChange ( plugin , pairs )
1818}
19- export function dealWithOldToMove ( ) {
2019
21- }
2220export function oldNavTreeChange ( plugin : Plugin , pairs : Pairs ) {
2321 pairs . forEach ( ( pair ) => {
2422 const targetInnerEl = pair . folder . innerEl ;
@@ -70,6 +68,8 @@ export function toMoveGenerationClassAdd(el: HTMLElement, path: string) {
7068 }
7169 el . addClass ( `g${ gen } ` ) ;
7270}
71+
72+ // get pairs
7373export function getPairs ( elements : ElementsObj ) : Pairs | undefined {
7474 const pairs : Pairs = [ ] ;
7575 elements . folders . forEach ( ( folder ) => {
@@ -88,8 +88,6 @@ export function getPairs(elements: ElementsObj): Pairs | undefined {
8888 return pairs . length > 0 ? pairs : undefined ;
8989}
9090
91-
92-
9391// Get Elements object from CLUSTERS folder
9492export function getElementsObj ( plugin : Plugin ) : ElementsObj | undefined {
9593 const fileExplorers = plugin . app . workspace . getLeavesOfType ( 'file-explorer' ) ;
0 commit comments