Skip to content

Commit

Permalink
Combine group moving to a single transaction, refs #59
Browse files Browse the repository at this point in the history
  • Loading branch information
bergie committed Feb 21, 2014
1 parent 607d387 commit 035c730
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions the-graph/the-graph-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@
var graph = this.state.graph;
var nodes = event.detail.nodes;

graph.startTransaction('movegroup');

// Move each group member
var len = nodes.length;
for (var i=0; i<len; i++) {
Expand All @@ -103,6 +105,8 @@
});
}
}

graph.endTransaction('movegroup');
},
listenComponentChanges: function (componentName) {
var componentEl = document.querySelector("the-component[name='"+componentName+"']");
Expand Down
5 changes: 4 additions & 1 deletion the-graph/the-graph-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

this.getDOMNode().addEventListener("track", this.onTrack);
this.getDOMNode().addEventListener("trackend", this.onTrackEnd);

//this.props.graph.startTransaction('movenode');

This comment has been minimized.

Copy link
@forresto

forresto Feb 21, 2014

Collaborator

Did this not work?

},
onTrack: function (event) {
// Don't fire on graph
Expand Down Expand Up @@ -65,6 +67,7 @@

this.getDOMNode().removeEventListener("track", this.onTrack);
this.getDOMNode().removeEventListener("trackend", this.onTrackEnd);
//this.props.graph.endTransaction('movenode');
},
stopPropagation: function (event) {
// HACK to keep context menu from cancelling preview edge
Expand Down Expand Up @@ -316,4 +319,4 @@
});


})(this);
})(this);

0 comments on commit 035c730

Please sign in to comment.