Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions dist/react-ui-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ module.exports = React.createClass({
},

dragEnd: function dragEnd() {
var index = this.state.tree.getIndex(this.state.dragging.id);
var parent = this.state.tree.get(index.parent);

this.setState({
dragging: {
id: null,
Expand All @@ -211,14 +214,14 @@ module.exports = React.createClass({
}
});

this.change(this.state.tree);
this.change(this.state.tree, parent, index.node);
window.removeEventListener('mousemove', this.drag);
window.removeEventListener('mouseup', this.dragEnd);
},

change: function change(tree) {
change(tree, parent, node) {
this._updated = true;
if (this.props.onChange) this.props.onChange(tree.obj);
if(this.props.onChange) this.props.onChange(tree.obj, parent, node);
},

toggleCollapse: function toggleCollapse(nodeId) {
Expand All @@ -232,6 +235,6 @@ module.exports = React.createClass({
tree: tree
});

this.change(tree);
this.change(tree, null, null);
}
});
});