mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 05:28:59 +01:00 
			
		
		
		
	refactor(geomap): skip module loader for JS
This commit is contained in:
		
							parent
							
								
									eca3955dc2
								
							
						
					
					
						commit
						2b8ee31be3
					
				@ -107,7 +107,6 @@ const HIGHLIGHT_JS: Library = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const LEAFLET: Library = {
 | 
					const LEAFLET: Library = {
 | 
				
			||||||
    js: [ "node_modules/leaflet/dist/leaflet.js" ],
 | 
					 | 
				
			||||||
    css: [ "node_modules/leaflet/dist/leaflet.css" ],
 | 
					    css: [ "node_modules/leaflet/dist/leaflet.css" ],
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -13,11 +13,8 @@ const TPL = `\
 | 
				
			|||||||
    </style>
 | 
					    </style>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <div class="geo-map-container"></div>
 | 
					    <div class="geo-map-container"></div>
 | 
				
			||||||
</div>
 | 
					</div>`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
`
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
//@ts-nocheck
 | 
					 | 
				
			||||||
export default class GeoMapWidget extends NoteContextAwareWidget {
 | 
					export default class GeoMapWidget extends NoteContextAwareWidget {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    constructor(widgetMode: "type") {
 | 
					    constructor(widgetMode: "type") {
 | 
				
			||||||
@ -30,7 +27,9 @@ export default class GeoMapWidget extends NoteContextAwareWidget {
 | 
				
			|||||||
        const $container = this.$widget.find(".geo-map-container");
 | 
					        const $container = this.$widget.find(".geo-map-container");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        library_loader.requireLibrary(library_loader.LEAFLET)
 | 
					        library_loader.requireLibrary(library_loader.LEAFLET)
 | 
				
			||||||
            .then(() => {
 | 
					            .then(async () => {
 | 
				
			||||||
 | 
					                const L = (await import("leaflet")).default;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                const map = L.map($container[0], {
 | 
					                const map = L.map($container[0], {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                });
 | 
					                });
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user