- {noteMapWidget}
+
+ {noteMapContainer}
+
+ {!isExpanded ? (
+
toggleExpanded(true)}
+ />
+ ) : (
+ toggleExpanded(false)}
+ />
+ )}
);
}
\ No newline at end of file
diff --git a/apps/client/src/widgets/ribbon/style.css b/apps/client/src/widgets/ribbon/style.css
index c70463659..c09fa989f 100644
--- a/apps/client/src/widgets/ribbon/style.css
+++ b/apps/client/src/widgets/ribbon/style.css
@@ -253,7 +253,7 @@
}
.note-map-ribbon-widget .note-map-container {
- height: 300px;
+ height: 100%;
}
.note-map-ribbon-widget .open-full-button, .note-map-ribbon-widget .collapse-button {
diff --git a/apps/client/src/widgets/ribbon_widgets/note_map.ts b/apps/client/src/widgets/ribbon_widgets/note_map.ts
index fe7a65479..93facf3db 100644
--- a/apps/client/src/widgets/ribbon_widgets/note_map.ts
+++ b/apps/client/src/widgets/ribbon_widgets/note_map.ts
@@ -2,14 +2,6 @@ import NoteContextAwareWidget from "../note_context_aware_widget.js";
import NoteMapWidget from "../note_map.js";
import { t } from "../../services/i18n.js";
-const TPL = /*html*/`
-
-
-
-
-
-
`;
-
export default class NoteMapRibbonWidget extends NoteContextAwareWidget {
private openState!: "small" | "full";
@@ -50,37 +42,7 @@ export default class NoteMapRibbonWidget extends NoteContextAwareWidget {
this.noteMapWidget.setDimensions();
});
- const handleResize = () => {
- if (!this.noteMapWidget.graph) {
- // no graph has been even rendered
- return;
- }
-
- if (this.openState === "full") {
- this.setFullHeight();
- } else if (this.openState === "small") {
- this.setSmallSize();
- }
- };
-
new ResizeObserver(handleResize).observe(this.$widget[0]);
}
- setSmallSize() {
- const SMALL_SIZE_HEIGHT = 300;
- const width = this.$widget.width() ?? 0;
-
- this.$widget.find(".note-map-container").height(SMALL_SIZE_HEIGHT).width(width);
- }
-
- setFullHeight() {
- const { top } = this.$widget[0].getBoundingClientRect();
-
- const height = ($(window).height() ?? 0) - top;
- const width = this.$widget.width() ?? 0;
-
- this.$widget.find(".note-map-container")
- .height(height)
- .width(width);
- }
}