Commit 584a9d9c authored by Boris Kocherov's avatar Boris Kocherov

fix and speedup render_schema_selector

parent 0d190623
......@@ -451,8 +451,7 @@
}
for (x = 0; x < schema_alternatives.length; x += 1) {
item = schema_alternatives[x];
// need speedup by using array index
item_list.push([item.title, JSON.stringify(item.value)]);
item_list.push([item.title, x]);
}
return {
name: scope,
......@@ -468,7 +467,7 @@
event: function () {
return g.getContent()
.push(function (value) {
return event(JSON.parse(value[scope]));
return event(schema_alternatives[value[scope]].value);
})
.push(function () {
return gadget.processValidation();
......@@ -890,7 +889,7 @@
for (x = 0; x < schema_alternatives.length; x += 1) {
item = schema_alternatives[x];
if (!used_properties.hasOwnProperty(item.value.property_name)) {
item_list.push([item.title, JSON.stringify(item.value)]);
item_list.push([item.title, x]);
}
}
return {
......
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