Skip to content

Commit

Permalink
Add node argument to the toDict() callback
Browse files Browse the repository at this point in the history
Close #465
  • Loading branch information
mar10 committed Jul 17, 2015
1 parent d5db90b commit 4e0d0b2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 2.11.0-0 / Unreleased
* [Changed] #434: Use data-uris to create inline images
* [Changed] #460: Use padding-left instead of margin for table indent
* [Changed] #465: Add `node` argument to the `toDict()` callback
* [Fixed] #411: ext-edit fails with ext-table, when edit was cancelled

# 2.10.2 / 2015-07-02
Expand Down
4 changes: 2 additions & 2 deletions src/jquery.fancytree.js
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,7 @@ FancytreeNode.prototype = /** @lends FancytreeNode# */{
* The result is compatible with node.addChildren().
*
* @param {boolean} [recursive=false] include child nodes
* @param {function} [callback] callback(dict) is called for every node, in order to allow modifications
* @param {function} [callback] callback(dict, node) is called for every node, in order to allow modifications
* @returns {NodeData}
*/
toDict: function(recursive, callback) {
Expand All @@ -1618,7 +1618,7 @@ FancytreeNode.prototype = /** @lends FancytreeNode# */{
}
}
if( callback ){
callback(dict);
callback(dict, self);
}
if( recursive ) {
if(this.hasChildren()){
Expand Down

0 comments on commit 4e0d0b2

Please sign in to comment.