mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 11:56:01 +01:00 
			
		
		
		
	fix notemap resize + upgrade of force-graph
This commit is contained in:
		
							
								
								
									
										6
									
								
								libraries/force-graph.min.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								libraries/force-graph.min.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@@ -156,7 +156,7 @@ export default class NoteDetailWidget extends NoteContextAwareWidget {
 | 
			
		||||
        // https://github.com/zadam/trilium/issues/2522
 | 
			
		||||
        this.$widget.toggleClass("full-height",
 | 
			
		||||
            !this.noteContext.hasNoteList()
 | 
			
		||||
            && ['editable-text', 'editable-code', 'canvas', 'web-view'].includes(this.type)
 | 
			
		||||
            && ['editable-text', 'editable-code', 'canvas', 'web-view', 'note-map'].includes(this.type)
 | 
			
		||||
            && this.mime !== 'text/x-sqlite;schema=trilium');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,8 +8,9 @@ import linkContextMenuService from "../services/link_context_menu.js";
 | 
			
		||||
 | 
			
		||||
const TPL = `<div class="note-map-widget" style="position: relative;">
 | 
			
		||||
    <style>
 | 
			
		||||
        .type-special .note-detail, .note-detail-note-map {
 | 
			
		||||
        .note-detail-note-map {
 | 
			
		||||
            height: 100%;
 | 
			
		||||
            overflow: hidden;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
        .map-type-switcher {
 | 
			
		||||
@@ -51,7 +52,7 @@ export default class NoteMapWidget extends NoteContextAwareWidget {
 | 
			
		||||
        this.$container = this.$widget.find(".note-map-container");
 | 
			
		||||
        this.$styleResolver = this.$widget.find('.style-resolver');
 | 
			
		||||
 | 
			
		||||
        window.addEventListener('resize', () => this.setHeight(), false);
 | 
			
		||||
        window.addEventListener('resize', () => this.setDimensions(), false);
 | 
			
		||||
 | 
			
		||||
        this.$widget.find(".map-type-switcher button").on("click",  async e => {
 | 
			
		||||
            const type = $(e.target).closest("button").attr("data-type");
 | 
			
		||||
@@ -62,7 +63,7 @@ export default class NoteMapWidget extends NoteContextAwareWidget {
 | 
			
		||||
        super.doRender();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    setHeight() {
 | 
			
		||||
    setDimensions() {
 | 
			
		||||
        if (!this.graph) { // no graph has been even rendered
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
@@ -85,7 +86,7 @@ export default class NoteMapWidget extends NoteContextAwareWidget {
 | 
			
		||||
 | 
			
		||||
        this.mapType = this.note.getLabelValue("mapType") === "tree" ? "tree" : "link";
 | 
			
		||||
 | 
			
		||||
        this.setHeight();
 | 
			
		||||
        this.setDimensions();
 | 
			
		||||
 | 
			
		||||
        await libraryLoader.requireLibrary(libraryLoader.FORCE_GRAPH);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -77,7 +77,7 @@ export default class NoteMapRibbonWidget extends NoteContextAwareWidget {
 | 
			
		||||
 | 
			
		||||
            this.openState = 'full';
 | 
			
		||||
 | 
			
		||||
            this.noteMapWidget.setHeight();
 | 
			
		||||
            this.noteMapWidget.setDimensions();
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        this.$collapseButton = this.$widget.find('.collapse-button');
 | 
			
		||||
@@ -89,7 +89,7 @@ export default class NoteMapRibbonWidget extends NoteContextAwareWidget {
 | 
			
		||||
 | 
			
		||||
            this.openState = 'small';
 | 
			
		||||
 | 
			
		||||
            this.noteMapWidget.setHeight();
 | 
			
		||||
            this.noteMapWidget.setDimensions();
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        window.addEventListener('resize', () => {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user