Skip to content

Commit

Permalink
Some code reorganization
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed May 23, 2016
1 parent f7c9b7d commit 67823c6
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/js/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -1302,19 +1302,20 @@ Node.prototype._updateDomValue = function () {
this.dom.tdSelect.className = 'jsoneditor-tree';
this.dom.tdSelect.appendChild(this.dom.select);
this.dom.tdValue.parentNode.insertBefore(this.dom.tdSelect, this.dom.tdValue);
}

//If the enum is inside a composite type display both the simple input and the dropdown field
if(this.schema !== undefined && (
!this.schema.hasOwnProperty("oneOf") &&
!this.schema.hasOwnProperty("anyOf") &&
!this.schema.hasOwnProperty("allOf"))
) {
this.valueFieldHTML = this.dom.tdValue.innerHTML;
this.dom.tdValue.style.visibility = 'hidden';
this.dom.tdValue.innerHTML = '';
} else {
delete this.valueFieldHTML;
}
// If the enum is inside a composite type display
// both the simple input and the dropdown field
if(this.schema && (
!this.schema.hasOwnProperty("oneOf") &&
!this.schema.hasOwnProperty("anyOf") &&
!this.schema.hasOwnProperty("allOf"))
) {
this.valueFieldHTML = this.dom.tdValue.innerHTML;
this.dom.tdValue.style.visibility = 'hidden';
this.dom.tdValue.innerHTML = '';
} else {
delete this.valueFieldHTML;
}
}
else {
Expand Down

0 comments on commit 67823c6

Please sign in to comment.