Commit 795f8518 authored by Boris Kocherov's avatar Boris Kocherov

allow change schema without touch current json_document

parent 93224584
......@@ -661,6 +661,7 @@
return json_document;
})
.push(function (json_d) {
gadget.state.value = JSON.stringify(json_d);
return tv4.validateMultiple(json_d, gadget.props.schema[""]);
})
.push(function (validation) {
......@@ -764,14 +765,17 @@
})
.declareMethod('render', function (options) {
return this.changeState({
var z = {
key: options.key,
value: JSON.stringify(options.value),
schema: JSON.stringify(options.schema),
saveOrigValue: options.saveOrigValue,
schema_url: options.schema_url,
editable: options.editable === undefined ? true : options.editable
});
};
if (options.value !== undefined) {
z.value = JSON.stringify(options.value);
}
return this.changeState(z);
})
.onStateChange(function () {
var g = this,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment