Skip to content

Commit

Permalink
Fixed enum drop downs not working when the JSONEditor is configured w…
Browse files Browse the repository at this point in the history
…ith a name (see josdejong#285)
  • Loading branch information
josdejong committed May 23, 2016
1 parent b18537f commit b67d683
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
https://github.com/josdejong/jsoneditor


## not yet released, version 5.5.5

- Fixed enum drop downs not working when the JSONEditor is configured with
a name.


## 2016-05-22, version 5.5.4

- Fixed #285: an issue with the enum drop down when having defined multiple
Expand Down
8 changes: 5 additions & 3 deletions src/js/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ Node.prototype.getPath = function () {
var node = this;
var path = [];
while (node) {
var field = (!node.parent || node.parent.type != 'array')
? node.field
: node.index;
var field = !node.parent
? undefined // do not add an (optional) field name of the root node
: (node.parent.type != 'array')
? node.field
: node.index;

if (field !== undefined) {
path.unshift(field);
Expand Down

0 comments on commit b67d683

Please sign in to comment.