mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-03 21:19:01 +01:00 
			
		
		
		
	chore(react/collections/geomap): fix editability
This commit is contained in:
		
							parent
							
								
									5854adb806
								
							
						
					
					
						commit
						0f9a529647
					
				@ -1,7 +1,7 @@
 | 
				
			|||||||
import Map from "./map";
 | 
					import Map from "./map";
 | 
				
			||||||
import "./index.css";
 | 
					import "./index.css";
 | 
				
			||||||
import { ViewModeProps } from "../interface";
 | 
					import { ViewModeProps } from "../interface";
 | 
				
			||||||
import { useNoteLabel, useNoteProperty, useSpacedUpdate } from "../../react/hooks";
 | 
					import { useNoteLabel, useNoteLabelBoolean, useNoteProperty, useSpacedUpdate } from "../../react/hooks";
 | 
				
			||||||
import { DEFAULT_MAP_LAYER_NAME } from "./map_layer";
 | 
					import { DEFAULT_MAP_LAYER_NAME } from "./map_layer";
 | 
				
			||||||
import { divIcon, LatLng } from "leaflet";
 | 
					import { divIcon, LatLng } from "leaflet";
 | 
				
			||||||
import { useCallback, useEffect, useMemo, useState } from "preact/hooks";
 | 
					import { useCallback, useEffect, useMemo, useState } from "preact/hooks";
 | 
				
			||||||
@ -26,7 +26,7 @@ interface MapData {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
export default function GeoView({ note, noteIds, viewConfig, saveConfig }: ViewModeProps<MapData>) {
 | 
					export default function GeoView({ note, noteIds, viewConfig, saveConfig }: ViewModeProps<MapData>) {
 | 
				
			||||||
    const [ layerName ] = useNoteLabel(note, "map:style");
 | 
					    const [ layerName ] = useNoteLabel(note, "map:style");
 | 
				
			||||||
    const [ isReadOnly ] = useNoteLabel(note, "readOnly");
 | 
					    const [ isReadOnly ] = useNoteLabelBoolean(note, "readOnly");
 | 
				
			||||||
    const [ notes, setNotes ] = useState<FNote[]>([]);
 | 
					    const [ notes, setNotes ] = useState<FNote[]>([]);
 | 
				
			||||||
    const spacedUpdate = useSpacedUpdate(() => {
 | 
					    const spacedUpdate = useSpacedUpdate(() => {
 | 
				
			||||||
        if (viewConfig) {
 | 
					        if (viewConfig) {
 | 
				
			||||||
@ -85,7 +85,7 @@ function NoteMarker({ note, editable }: { note: FNote, editable: boolean }) {
 | 
				
			|||||||
        icon={icon}
 | 
					        icon={icon}
 | 
				
			||||||
        mouseDown={onMouseDown}
 | 
					        mouseDown={onMouseDown}
 | 
				
			||||||
        draggable={editable}
 | 
					        draggable={editable}
 | 
				
			||||||
        dragged={onDragged}
 | 
					        dragged={editable ? onDragged : undefined}
 | 
				
			||||||
    />
 | 
					    />
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -6,7 +6,7 @@ export interface MarkerProps {
 | 
				
			|||||||
    coordinates: [ number, number ];
 | 
					    coordinates: [ number, number ];
 | 
				
			||||||
    icon?: Icon | DivIcon;
 | 
					    icon?: Icon | DivIcon;
 | 
				
			||||||
    mouseDown?: (e: MouseEvent) => void;
 | 
					    mouseDown?: (e: MouseEvent) => void;
 | 
				
			||||||
    dragged: ((newCoordinates: LatLng) => void)
 | 
					    dragged?: ((newCoordinates: LatLng) => void);
 | 
				
			||||||
    draggable?: boolean;
 | 
					    draggable?: boolean;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user