Skip to content

fix for issue 12 #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ return /******/ (function(modules) { // webpackBootstrap
_createClass(TreeNode, [{
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
this.setState({ node: nextProps.node, expanded: true });
this.setState({ node: nextProps.node });
/*this.expanded = (nextProps.node.state && nextProps.node.state.hasOwnProperty('expanded')) ?
nextProps.node.state.expanded :
(this.props.level < this.props.options.levels);*/
Expand Down Expand Up @@ -21213,4 +21213,4 @@ return /******/ (function(modules) { // webpackBootstrap
/***/ }
/******/ ])
});
;
;
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "treeview-react-bootstrap",
"name": "treeview-react-bootstrap-fix",
"version": "0.4.6",
"description": "Nice, easy to use component to displaying tree structures, made with React and Twitter Bootstrap",
"main": "index.js",
Expand All @@ -8,7 +8,7 @@
},
"repository": {
"type": "git",
"url": "https://github.com/eliftech/treeview-react-bootstrap.git"
"url": "git+https://github.com/wouterbeets/treeview-react-bootstrap.git"
},
"keywords": [
"tree",
Expand All @@ -19,17 +19,15 @@
"bootstrap",
"javascript"
],
"author": {
"name": "Elif Technologies"
},
"author": "Wouter Beets",
"licenses": [
{
"type": "MIT",
"url": "https://github.com/eliftech/treeview-react-bootstrap/blob/master/LICENSE"
"url": "https://github.com/wouterbeets/treeview-react-bootstrap/blob/master/LICENSE"
}
],
"bugs": {
"url": "https://github.com/eliftech/treeview-react-bootstrap/issues"
"url": "https://github.com/wouterbeets/treeview-react-bootstrap/issues"
},
"devDependencies": {
"babel-core": "^6.3.21",
Expand All @@ -43,5 +41,7 @@
},
"peerDependencies": {
"react": ">= 0.14.6"
}
},
"homepage": "https://github.com/wouterbeets/treeview-react-bootstrap#readme",
"license": "ISC"
}
2 changes: 1 addition & 1 deletion src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ export class TreeNode extends React.Component {
}

componentWillReceiveProps(nextProps) {
this.setState({node: nextProps.node, expanded: true});
this.setState({node: nextProps.node});
/*this.expanded = (nextProps.node.state && nextProps.node.state.hasOwnProperty('expanded')) ?
nextProps.node.state.expanded :
(this.props.level < this.props.options.levels);*/
Expand Down