mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 07:01:31 +08:00 
			
		
		
		
	fix "note paths" ribbon widget for root note
This commit is contained in:
		
							parent
							
								
									40fb4ff56b
								
							
						
					
					
						commit
						89c04e6b6b
					
				
							
								
								
									
										10
									
								
								.idea/runConfigurations.xml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										10
									
								
								.idea/runConfigurations.xml
									
									
									
										generated
									
									
									
								
							@ -1,10 +0,0 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
<project version="4">
 | 
			
		||||
  <component name="RunConfigurationProducerService">
 | 
			
		||||
    <option name="ignoredProducers">
 | 
			
		||||
      <set>
 | 
			
		||||
        <option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
 | 
			
		||||
      </set>
 | 
			
		||||
    </option>
 | 
			
		||||
  </component>
 | 
			
		||||
</project>
 | 
			
		||||
@ -81,7 +81,7 @@
 | 
			
		||||
  },
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "cross-env": "7.0.3",
 | 
			
		||||
    "electron": "13.6.2",
 | 
			
		||||
    "electron": "13.6.3",
 | 
			
		||||
    "electron-builder": "22.13.1",
 | 
			
		||||
    "electron-packager": "15.4.0",
 | 
			
		||||
    "electron-rebuild": "3.2.3",
 | 
			
		||||
 | 
			
		||||
@ -69,7 +69,10 @@ export default class NotePathsWidget extends NoteContextAwareWidget {
 | 
			
		||||
        this.$notePathList.empty();
 | 
			
		||||
 | 
			
		||||
        if (this.noteId === 'root') {
 | 
			
		||||
            await this.getRenderedPath('root');
 | 
			
		||||
            this.$notePathList.empty().append(
 | 
			
		||||
                await this.getRenderedPath('root')
 | 
			
		||||
            );
 | 
			
		||||
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -94,7 +97,7 @@ export default class NotePathsWidget extends NoteContextAwareWidget {
 | 
			
		||||
        this.$notePathList.empty().append(...renderedPaths);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    async getRenderedPath(notePath, notePathRecord) {
 | 
			
		||||
    async getRenderedPath(notePath, notePathRecord = null) {
 | 
			
		||||
        const title = await treeService.getNotePathTitle(notePath);
 | 
			
		||||
 | 
			
		||||
        const $noteLink = await linkService.createNoteLink(notePath, {title});
 | 
			
		||||
@ -109,20 +112,20 @@ export default class NotePathsWidget extends NoteContextAwareWidget {
 | 
			
		||||
            $noteLink.addClass("path-current");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (notePathRecord.isInHoistedSubTree) {
 | 
			
		||||
        if (!notePathRecord || notePathRecord.isInHoistedSubTree) {
 | 
			
		||||
            $noteLink.addClass("path-in-hoisted-subtree");
 | 
			
		||||
        }
 | 
			
		||||
        else {
 | 
			
		||||
            icons.push(`<span class="bx bx-trending-up" title="This path is outside of hoisted note and you would have to unhoist."></span>`);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (notePathRecord.isArchived) {
 | 
			
		||||
        if (notePathRecord?.isArchived) {
 | 
			
		||||
            $noteLink.addClass("path-archived");
 | 
			
		||||
 | 
			
		||||
            icons.push(`<span class="bx bx-archive" title="Archived"></span>`);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (notePathRecord.isSearch) {
 | 
			
		||||
        if (notePathRecord?.isSearch) {
 | 
			
		||||
            $noteLink.addClass("path-search");
 | 
			
		||||
 | 
			
		||||
            icons.push(`<span class="bx bx-search" title="Search"></span>`);
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user