Skip to content

Commit

Permalink
fixed an issue preventing proper movement of subnodes in relation to …
Browse files Browse the repository at this point in the history
…a parent node.
  • Loading branch information
paulkoanui committed Jul 28, 2017
1 parent fc09c2a commit 7c3a880
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/MindMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class MindMap extends Component {
/*
* Add new class to nodes, attach drag behavior, and start simulation.
*/
prepareEditor(svg, conns, nodes) {
prepareEditor(svg, conns, nodes, subnodes) {
nodes
.attr('class', 'mindmap-node mindmap-node--editable')
.on('dblclick', (node) => {
Expand All @@ -71,7 +71,7 @@ export default class MindMap extends Component {
nodes.call(d3Drag(this.state.simulation, svg, nodes));

this.state.simulation
.alphaTarget(0.5).on('tick', () => onTick(conns, nodes));
.alphaTarget(0.5).on('tick', () => onTick(conns, nodes, subnodes));
}
/* eslint-enable no-param-reassign */

Expand Down Expand Up @@ -99,7 +99,7 @@ export default class MindMap extends Component {
.force('link').links(this.props.connections);

if (this.props.editable) {
this.prepareEditor(svg, connections, nodes);
this.prepareEditor(svg, connections, nodes, subnodes);
}

// Tick the simulation 100 times.
Expand Down

0 comments on commit 7c3a880

Please sign in to comment.