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

cleanup

parent 92c0ac7d
......@@ -61,16 +61,6 @@
return schema;
}
function loadJSONSchema(g, url, path) {
if (g.props.toplevel) {
return g.loadJSONSchema(url, path);
}
path = g.element.getAttribute('data-json-parent') +
encodeJsonPointer(g.element.getAttribute('data-json-property-name')) +
path;
return g.loadJSONSchemaParent(url, path);
}
function getDocumentType(doc) {
if (doc instanceof Array) {
return "array";
......@@ -274,7 +264,7 @@
}
if (json_field.$ref !== undefined) {
return loadJSONSchema(gadget, json_field.$ref, first_path)
return gadget.loadJSONSchema(json_field.$ref, first_path)
.push(function (schema_part) {
return render_field(gadget, key, path, schema_part, default_value, root);
});
......@@ -920,6 +910,12 @@
download_url,
base_url,
hash;
if (!g.props.toplevel) {
path = g.element.getAttribute('data-json-parent') +
encodeJsonPointer(g.element.getAttribute('data-json-property-name')) +
path;
return g.loadJSONSchemaParent(url, path);
}
// XXX need use $id
base_url = getBaseUrl(g, path);
if (!base_url) {
......@@ -957,7 +953,7 @@
})
.declareAcquiredMethod("loadJSONSchemaParent", "loadJSONSchemaTop")
.allowPublicAcquisition("loadJSONSchemaTop", function (arr) {
return loadJSONSchema(this, arr[0], arr[1]);
return this.loadJSONSchema(arr[0], arr[1]);
})
.declareMethod('render', function (options) {
var g = this,
......@@ -978,7 +974,7 @@
return options.schema;
});
} else {
queue = loadJSONSchema(g, options.schema_url);
queue = g.loadJSONSchema(options.schema_url);
}
return queue
.push(function (schema) {
......
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