json-editor
Advanced tools
Comparing version 0.7.12 to 0.7.13
{ | ||
"name": "json-editor", | ||
"version": "0.7.12", | ||
"version": "0.7.13", | ||
"authors": [ | ||
@@ -5,0 +5,0 @@ "Jeremy Dorn <jeremy@jeremydorn.com>" |
@@ -5,3 +5,3 @@ { | ||
"description": "JSON Schema based editor", | ||
"version": "0.7.12", | ||
"version": "0.7.13", | ||
"main": "dist/jsoneditor.js", | ||
@@ -8,0 +8,0 @@ "author": { |
@@ -58,2 +58,3 @@ var JSONEditor = function(element,options) { | ||
window.requestAnimationFrame(function() { | ||
if(!self.ready) return; | ||
self.validation_results = self.validator.validate(self.root.getValue()); | ||
@@ -195,3 +196,4 @@ self.root.showValidationErrors(self.validation_results); | ||
self.firing_change = false; | ||
if(!self.ready) return; | ||
// Validate and cache results | ||
@@ -198,0 +200,0 @@ self.validation_results = self.validator.validate(self.root.getValue()); |
@@ -509,9 +509,29 @@ JSONEditor.defaults.editors.object = JSONEditor.AbstractEditor.extend({ | ||
}, | ||
insertPropertyControlUsingPropertyOrder: function (property, control, container) { | ||
var propertyOrder = this.schema.properties[property].propertyOrder; | ||
if (typeof propertyOrder !== "number") propertyOrder = 1000; | ||
control.propertyOrder = propertyOrder; | ||
for (var i = 0; i < container.childNodes.length; i++) { | ||
var child = container.childNodes[i]; | ||
if (control.propertyOrder < child.propertyOrder) { | ||
this.addproperty_list.insertBefore(control, child); | ||
control = null; | ||
break; | ||
} | ||
} | ||
if (control) { | ||
this.addproperty_list.appendChild(control); | ||
} | ||
}, | ||
addPropertyCheckbox: function(key) { | ||
var self = this; | ||
var checkbox, label, control; | ||
var checkbox, label, labelText, control; | ||
checkbox = self.theme.getCheckbox(); | ||
checkbox.style.width = 'auto'; | ||
label = self.theme.getCheckboxLabel(key); | ||
labelText = this.schema.properties[key].title ? this.schema.properties[key].title : key; | ||
label = self.theme.getCheckboxLabel(labelText); | ||
control = self.theme.getFormControl(label,checkbox); | ||
@@ -521,4 +541,5 @@ control.style.paddingBottom = control.style.marginBottom = control.style.paddingTop = control.style.marginTop = 0; | ||
//control.style.overflowY = 'hidden'; | ||
self.addproperty_list.appendChild(control); | ||
this.insertPropertyControlUsingPropertyOrder(key, control, this.addproperty_list); | ||
checkbox.checked = key in this.editors; | ||
@@ -631,3 +652,3 @@ checkbox.addEventListener('change',function() { | ||
canHaveAdditionalProperties: function() { | ||
return this.schema.additionalProperties !== false && !this.jsoneditor.options.no_additional_properties; | ||
return (this.schema.additionalProperties === true) || !this.jsoneditor.options.no_additional_properties; | ||
}, | ||
@@ -672,3 +693,3 @@ destroy: function() { | ||
refreshAddProperties: function() { | ||
if(this.options.disable_properties || this.jsoneditor.options.disable_properties) { | ||
if(this.options.disable_properties || (this.options.disable_properties !== false && this.jsoneditor.options.disable_properties)) { | ||
this.addproperty_controls.style.display = 'none'; | ||
@@ -733,3 +754,2 @@ return; | ||
this.addPropertyCheckbox(i); | ||
this.addproperty_checkboxes[i].disabled = !can_add; | ||
} | ||
@@ -736,0 +756,0 @@ |
@@ -1,6 +0,6 @@ | ||
/*! JSON Editor v0.7.12 - JSON Schema -> HTML Editor | ||
/*! JSON Editor v0.7.13 - JSON Schema -> HTML Editor | ||
* By Jeremy Dorn - https://github.com/jdorn/json-editor/ | ||
* Released under the MIT license | ||
* | ||
* Date: 2014-10-05 | ||
* Date: 2014-11-11 | ||
*/ | ||
@@ -7,0 +7,0 @@ |
@@ -71,4 +71,4 @@ // Base Foundation theme | ||
if(!input.errmsg) { | ||
input.insertAdjacentHTML('afterend','<small class="errormsg"></small>'); | ||
input.errmsg = input.parentNode.getElementsByClassName('errormsg')[0]; | ||
input.insertAdjacentHTML('afterend','<small class="error"></small>'); | ||
input.errmsg = input.parentNode.getElementsByClassName('error')[0]; | ||
} | ||
@@ -75,0 +75,0 @@ else { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
665560
13217