-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
25 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
|
@@ -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. | ||
|
||
|
@@ -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. | ||
|
||
|
@@ -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. | ||
|
||
|
@@ -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; | ||
} | ||
|
@@ -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(); | ||
} | ||
|
Oops, something went wrong.