Commit 73205edc authored by Boris Kocherov's avatar Boris Kocherov

simplify rerender

parent 12d8ca64
......@@ -247,25 +247,17 @@
gadget_settings,
path;
function f(p) {
var settings;
function f(settings_path, rerender_path) {
return g.getDeclaredGadget("xmla_settings")
.push(function (gadget) {
gadget_settings = gadget;
return gadget.getContent(p);
return gadget.getContent(settings_path);
})
.push(function (c) {
settings = c;
return generateSchema(c);
.push(function (settings) {
return generateSchema(settings);
})
.push(function (schema) {
return gadget_settings.getGadgetByPath(p + '/properties')
.push(function (ret) {
return ret.gadget.rerender({
schema: schema,
value: convertOnMultiLevel(settings, '/properties')
});
});
return gadget_settings.rerender(rerender_path, schema);
})
.push(function () {
// return g.notifyChange();
......@@ -275,7 +267,7 @@
for (path in g.props.xmla_connections) {
if (g.props.xmla_connections.hasOwnProperty(path) &&
p.startsWith(path)) {
return f(path);
return f(path, g.props.xmla_connections[path]);
}
}
// return g.notifyChange();
......@@ -301,7 +293,7 @@
return generateSchema(settings);
})
.push(function (s) {
g.props.xmla_connections[connection_path] = false;
g.props.xmla_connections[connection_path] = path;
return s;
});
}
......
......@@ -935,6 +935,24 @@
return g;
});
})
.declareMethod('rerender', function (path, schema) {
var g = this,
gadget;
if (path) {
return g.props.form_gadget.getGadgetByPath(path)
.push(function (ret) {
gadget = ret.gadget;
return gadget.getContent();
})
.push(function (value) {
return gadget.rerender({
schema: schema,
value: value
});
});
}
})
.allowPublicAcquisition("expandSchema", function (arr) {
return expandSchemaForField(this, arr[0], arr[1], arr[2], arr[3]);
})
......
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