Skip to content

Commit

Permalink
v1.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed May 17, 2017
1 parent 8ec6e91 commit 1aaf8b7
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 5 deletions.
8 changes: 7 additions & 1 deletion dist/infinite-tree.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! infinite-tree v1.10.0 | (c) 2017 Cheton Wu <[email protected]> | MIT | https://github.com/cheton/infinite-tree */
/*! infinite-tree v1.11.0 | (c) 2017 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 @@ -989,6 +989,8 @@ var InfiniteTree = function (_events$EventEmitter) {
return false;
}

this.emit('willCloseNode', node);

// Retrieve node index
var nodeIndex = this.nodes.indexOf(node);
if (nodeIndex < 0) {
Expand Down Expand Up @@ -1295,6 +1297,8 @@ var InfiniteTree = function (_events$EventEmitter) {
return false;
}

this.emit('willOpenNode', node);

// Retrieve node index
var nodeIndex = this.nodes.indexOf(node);
if (nodeIndex < 0) {
Expand Down Expand Up @@ -1647,6 +1651,8 @@ var InfiniteTree = function (_events$EventEmitter) {
_options4$silent = _options4.silent,
silent = _options4$silent === undefined ? false : _options4$silent;

this.emit('willSelectNode', node);

if (!selectable) {
return false;
}
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.

9 changes: 9 additions & 0 deletions examples/classic/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,15 @@ tree.on('selectNode', (node) => {
console.log('selectNode', node);
updatePreview(node);
});
tree.on('willOpenNode', (node) => {
console.log('willOpenNode:', node);
});
tree.on('willCloseNode', (node) => {
console.log('willCloseNode:', node);
});
tree.on('willSelectNode', (node) => {
console.log('willSelectNode:', node);
});
tree.on('clusterDidChange', () => {
const overlayElement = document.createElement('div');
const top = tree.nodes.indexOf(tree.getNodeById('<root>.1'));
Expand Down
9 changes: 9 additions & 0 deletions examples/default/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,15 @@ tree.on('selectNode', (node) => {
console.log('selectNode', node);
updatePreview(node);
});
tree.on('willOpenNode', (node) => {
console.log('willOpenNode:', node);
});
tree.on('willCloseNode', (node) => {
console.log('willCloseNode:', node);
});
tree.on('willSelectNode', (node) => {
console.log('willSelectNode:', node);
});
tree.on('clusterDidChange', () => {
const overlayElement = document.createElement('div');
const top = tree.nodes.indexOf(tree.getNodeById('<root>.1'));
Expand Down
9 changes: 9 additions & 0 deletions examples/filebrowser/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ tree.on('closeNode', (node) => {
tree.on('selectNode', (node) => {
console.log('selectNode', node);
});
tree.on('willOpenNode', (node) => {
console.log('willOpenNode:', node);
});
tree.on('willCloseNode', (node) => {
console.log('willCloseNode:', node);
});
tree.on('willSelectNode', (node) => {
console.log('willSelectNode:', node);
});

tree.loadData(data);

Expand Down
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.10.0",
"version": "1.11.0",
"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 1aaf8b7

Please sign in to comment.