Skip to content

Commit

Permalink
v1.16.1
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Jun 1, 2018
1 parent 11f30fa commit eddda39
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
16 changes: 13 additions & 3 deletions dist/infinite-tree.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! infinite-tree v1.16.0 | (c) 2018 Cheton Wu <[email protected]> | MIT | https://github.com/cheton/infinite-tree */
/*! infinite-tree v1.16.1 | (c) 2018 Cheton Wu <[email protected]> | MIT | https://github.com/cheton/infinite-tree */
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
Expand Down Expand Up @@ -1546,6 +1546,12 @@ var InfiniteTree = function (_events$EventEmitter) {

this.emit('willCloseNode', node);

// Cannot close the root node
if (node === this.state.rootNode) {
error('Cannot close the root node');
return false;
}

// Retrieve node index
var nodeIndex = this.nodes.indexOf(node);
if (nodeIndex < 0) {
Expand Down Expand Up @@ -2232,7 +2238,9 @@ var InfiniteTree = function (_events$EventEmitter) {

// Update parent node
parentNode.children = [];
parentNode.state.open = parentNode.state.open && parentNode.children.length > 0;
if (parentNode !== this.state.rootNode) {
parentNode.state.open = parentNode.state.open && parentNode.children.length > 0;
}

if (parentNodeIndex >= 0) {
// Update nodes & rows
Expand Down Expand Up @@ -2321,7 +2329,9 @@ var InfiniteTree = function (_events$EventEmitter) {

// Update parent node
parentNode.children.splice(parentNode.children.indexOf(node), 1);
parentNode.state.open = parentNode.state.open && parentNode.children.length > 0;
if (parentNode !== this.state.rootNode) {
parentNode.state.open = parentNode.state.open && parentNode.children.length > 0;
}

if (nodeIndex >= 0) {
// Update nodes & rows
Expand Down
4 changes: 2 additions & 2 deletions dist/infinite-tree.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/examples.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "infinite-tree",
"version": "1.16.0",
"version": "1.16.1",
"description": "A browser-ready tree library that can efficiently display a large amount of data using infinite scrolling.",
"homepage": "https://github.com/cheton/infinite-tree",
"main": "lib/index.js",
Expand Down

0 comments on commit eddda39

Please sign in to comment.