Commit 6da36ae6 authored by Boris Kocherov's avatar Boris Kocherov

cleanup render()

parent f3caa368
......@@ -1429,8 +1429,7 @@
return this.loadJSONSchema(arr[0], arr[1]);
})
.declareMethod('render', function (options) {
var g = this,
queue;
var g = this;
g.props.toplevel = true;
// contain map of current normalized schema
// json pointer and corresponding url
......@@ -1438,19 +1437,18 @@
g.props.schema = {};
g.props.schema_map = {};
g.props.schema_cache = {};
g.options = options;
if (!options.value) {
options.value = {};
}
if (options.schema) {
queue = RSVP.Queue()
.push(function () {
return RSVP.Queue()
.push(function () {
if (options.schema) {
return options.schema;
});
} else {
queue = g.loadJSONSchema(options.schema_url);
}
return queue
}
var schema_url = options.schema_url ||
(options.value && options.value.$schema);
if (schema_url) {
return g.loadJSONSchema(schema_url);
}
return {};
})
.push(function (schema) {
g.options.schema = schema;
return g.renderForm({
......
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