Skip to content

Commit

Permalink
v1.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Apr 6, 2017
1 parent 208e2dd commit 6b251a0
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
23 changes: 21 additions & 2 deletions dist/infinite-tree.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! infinite-tree v1.9.0 | (c) 2017 Cheton Wu <[email protected]> | MIT | https://github.com/cheton/infinite-tree */
/*! infinite-tree v1.10.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 @@ -1122,12 +1122,31 @@ var InfiniteTree = function (_events$EventEmitter) {
return node.id === id;
})[0];
if (!node) {
return undefined;
return null;
}
this.nodeTable.set(node.id, node);
}
return node;
};
// Returns the node at the specified point. If the specified point is outside the visible bounds or either coordinate is negative, the result is null.
// @param {number} x A horizontal position within the current viewport.
// @param {number} y A vertical position within the current viewport.
// @return {Node} The Node object under the given points.


InfiniteTree.prototype.getNodeFromPoint = function getNodeFromPoint(x, y) {
var el = document.elementFromPoint(x, y);
while (el && el.parentElement !== this.contentElement) {
el = el.parentElement;
}
if (!el) {
return null;
}
var id = el.getAttribute(this.options.nodeIdAttr);
var node = this.getNodeById(id);

return node;
};
// Gets an array of open nodes.
// @return {array} Returns an array of Node objects containing open nodes.

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.9.0",
"version": "1.10.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 6b251a0

Please sign in to comment.