Skip to content
Snippets Groups Projects
Commit 132e26ae authored by Matthias Konitzny's avatar Matthias Konitzny :fire:
Browse files

Fixed a bug caused graph width calculation to fail on load.

parent d9087f9d
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@ export { getClientWidth, getWindowInnerHeight };
* @returns {number}
*/
function getClientWidth(elementId: string): number {
return document.getElementById("knowledge-space-display").clientWidth;
return document.getElementById(elementId).clientWidth;
}
/**
......
......@@ -4,7 +4,7 @@ import { loadGraphJson } from "../common/datasets";
import { NodeDetails } from "./components/nodedetails";
import { SpaceSelect } from "./components/spaceselect";
import "./editor.css";
import * as Helpers from "../common/helpers";
import { Node } from "../common/graph/node";
import { NodeTypesEditor } from "./components/nodetypeseditor";
......@@ -153,7 +153,7 @@ export class Editor extends React.PureComponent<propTypes, stateTypes> {
* Processes resize window event. Focusses on resizing the graph accordingly.
*/
private handleResize() {
const newGraphWidth = this.graphContainer.current.clientWidth;
const newGraphWidth = Helpers.getClientWidth("knowledge-space-editor");
this.setState({
graphWidth: newGraphWidth,
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment