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

fix and speedup render_schema_selector

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