diff --git a/HISTORY.md b/HISTORY.md index 083c265..8b97c53 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -3,6 +3,11 @@ https://github.com/josdejong/jsoneditor +## not yet released, version 5.9.3 + +- Fixed broken multi-selection. + + ## 2017-07-13, version 5.9.2 - Fixed a bug in the JSON sanitizer. diff --git a/src/js/Node.js b/src/js/Node.js index 1725439..f7a077a 100644 --- a/src/js/Node.js +++ b/src/js/Node.js @@ -372,6 +372,16 @@ Node.prototype.getLevel = function() { return (this.parent ? this.parent.getLevel() + 1 : 0); }; +/** + * Get jsonpath of the current node + * @return {Node[]} Returns an array with nodes + */ +Node.prototype.getNodePath = function () { + var path = this.parent ? this.parent.getNodePath() : []; + path.push(this); + return path; +}; + /** * Create a clone of a node * The complete state of a clone is copied, including whether it is expanded or