Commit 8c3b49ae authored by Boris Kocherov's avatar Boris Kocherov

fix scope collision after splitting

parent 08eb2298
...@@ -14,8 +14,5 @@ ...@@ -14,8 +14,5 @@
<script src="gadget_json_generated_form.js" type="text/javascript"></script> <script src="gadget_json_generated_form.js" type="text/javascript"></script>
</head> </head>
<body> <body>
<div data-gadget-url="gadget_json_generated_form_child.html"
data-gadget-scope="json_form_child"
data-gadget-sandbox="public"></div>
</body> </body>
</html> </html>
...@@ -511,9 +511,18 @@ ...@@ -511,9 +511,18 @@
// message: error_message can be array containing dom elements // message: error_message can be array containing dom elements
// } // }
g.props.schema_resolve_errors = {}; g.props.schema_resolve_errors = {};
return g.getDeclaredGadget("json_form_child") return RSVP.Queue()
.push(function (json_form_child) { .push(function () {
g.props.form_gadget = json_form_child; if (!g.props.form_gadget) {
return g.declareGadget('gadget_json_generated_form_child.html',
{scope: "j" + Math.random().toString(36).substr(2, 9)})
.push(function (json_form_child) {
g.props.form_gadget = json_form_child;
g.element.appendChild(json_form_child.element);
});
}
})
.push(function () {
if (options.schema) { if (options.schema) {
return options.schema; return options.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