Fixed enum drop downs not working when the JSONEditor is configured with a name (see #285)

This commit is contained in:
jos 2016-05-23 20:35:24 +02:00
parent b18537f976
commit b67d683f1a
2 changed files with 11 additions and 3 deletions

View File

@ -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

View File

@ -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);