Skip to content

Commit

Permalink
v1.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Sep 29, 2016
1 parent 053d0dd commit bd53c66
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
28 changes: 22 additions & 6 deletions dist/infinite-tree.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! infinite-tree v1.7.1 | (c) 2016 Cheton Wu <[email protected]> | MIT | https://github.com/cheton/infinite-tree */
/*! infinite-tree v1.7.2 | (c) 2016 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 @@ -600,7 +600,7 @@ return /******/ (function(modules) { // webpackBootstrap
// * If the parent is null or undefined, inserts the child at the specified index in the top-level.
// * If the parent has children, the method adds the child as the last child.
// * If the parent does not have children, the method adds the child to the parent.
// @param {Object} newNode The new child node.
// @param {object} newNode The new child node.
// @param {Node} parentNode The Node object that defines the parent node.
// @return {boolean} Returns true on success, false otherwise.

Expand Down Expand Up @@ -809,7 +809,7 @@ return /******/ (function(modules) { // webpackBootstrap
return this.state.selectedNode;
};
// Inserts the specified node after the reference node.
// @param {Object} newNode The new sibling node.
// @param {object} newNode The new sibling node.
// @param {Node} referenceNode The Node object that defines the reference node.
// @return {boolean} Returns true on success, false otherwise.

Expand All @@ -826,7 +826,7 @@ return /******/ (function(modules) { // webpackBootstrap
return this.addChildNodes(newNodes, index, parentNode);
};
// Inserts the specified node before the reference node.
// @param {Object} newNode The new sibling node.
// @param {object} newNode The new sibling node.
// @param {Node} referenceNode The Node object that defines the reference node.
// @return {boolean} Returns true on success, false otherwise.

Expand Down Expand Up @@ -1408,10 +1408,12 @@ return /******/ (function(modules) { // webpackBootstrap
};
// Updates the data of a node.
// @param {Node} node The Node object.
// @param {Object} data The data object.
// @param {object} data The data object.
// @param {object} [options] The options object.
// @param {boolean} [options.shallowRendering] True to render only the parent node, false to render the parent node and all expanded child nodes. Defaults to false.


InfiniteTree.prototype.updateNode = function updateNode(node, data) {
InfiniteTree.prototype.updateNode = function updateNode(node, data, options) {
if (!ensureNodeInstance(node)) {
return;
}
Expand All @@ -1429,9 +1431,23 @@ return /******/ (function(modules) { // webpackBootstrap
// Retrieve node index
var nodeIndex = this.nodes.indexOf(node);
if (nodeIndex >= 0) {
var _options5 = _extends({}, options);

var _options5$shallowRend = _options5.shallowRendering;
var shallowRendering = _options5$shallowRend === undefined ? false : _options5$shallowRend;

// Update the row corresponding to the node

this.rows[nodeIndex] = this.options.rowRenderer(node, this.options);

if (!shallowRendering) {
var rangeFrom = nodeIndex + 1;
var rangeTo = nodeIndex + node.state.total;
for (var index = rangeFrom; index <= rangeTo; ++index) {
this.rows[index] = this.options.rowRenderer(this.nodes[index], this.options);
}
}

// Updates list with new data
this.update();
}
Expand Down
Loading

0 comments on commit bd53c66

Please sign in to comment.