mirror of
https://github.com/zadam/trilium.git
synced 2025-12-06 07:24:25 +01:00
Fix (NoteMap): map overflows when switching type in ribbon (#7939)
This commit is contained in:
parent
d173cc982c
commit
9fcee9cc53
@ -95,13 +95,13 @@ export default function NoteMap({ note, widgetMode, parentRef }: NoteMapProps) {
|
|||||||
if (!graphRef.current || !notesAndRelationsRef.current) return;
|
if (!graphRef.current || !notesAndRelationsRef.current) return;
|
||||||
graphRef.current.d3Force("link")?.distance(linkDistance);
|
graphRef.current.d3Force("link")?.distance(linkDistance);
|
||||||
graphRef.current.graphData(notesAndRelationsRef.current);
|
graphRef.current.graphData(notesAndRelationsRef.current);
|
||||||
}, [ linkDistance ]);
|
}, [ linkDistance, mapType ]);
|
||||||
|
|
||||||
// React to container size
|
// React to container size
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!containerSize || !graphRef.current) return;
|
if (!containerSize || !graphRef.current) return;
|
||||||
graphRef.current.width(containerSize.width).height(containerSize.height);
|
graphRef.current.width(containerSize.width).height(containerSize.height);
|
||||||
}, [ containerSize?.width, containerSize?.height ]);
|
}, [ containerSize?.width, containerSize?.height, mapType ]);
|
||||||
|
|
||||||
// Fixing nodes when dragged.
|
// Fixing nodes when dragged.
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -114,7 +114,7 @@ export default function NoteMap({ note, widgetMode, parentRef }: NoteMapProps) {
|
|||||||
node.fy = undefined;
|
node.fy = undefined;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}, [ fixNodes ]);
|
}, [ fixNodes, mapType ]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="note-map-widget">
|
<div className="note-map-widget">
|
||||||
|
|||||||
@ -29,14 +29,14 @@ export default function NoteMapTab({ note }: TabContext) {
|
|||||||
|
|
||||||
{!isExpanded ? (
|
{!isExpanded ? (
|
||||||
<ActionButton
|
<ActionButton
|
||||||
icon="bx bx-arrow-to-bottom"
|
icon="bx bx-expand-vertical"
|
||||||
text={t("note_map.open_full")}
|
text={t("note_map.open_full")}
|
||||||
className="open-full-button"
|
className="open-full-button"
|
||||||
onClick={() => setExpanded(true)}
|
onClick={() => setExpanded(true)}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<ActionButton
|
<ActionButton
|
||||||
icon="bx bx-arrow-to-top"
|
icon="bx bx-collapse-vertical"
|
||||||
text={t("note_map.collapse")}
|
text={t("note_map.collapse")}
|
||||||
className="collapse-button"
|
className="collapse-button"
|
||||||
onClick={() => setExpanded(false)}
|
onClick={() => setExpanded(false)}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user