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

cleanup

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