Commit 2733e960 authored by Boris Kocherov's avatar Boris Kocherov

use scope as part id then leading symbol not number for generating

parent 5adfb60f
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
parent_path, parent_path,
scope; scope;
scope = Math.random().toString(36).substr(2, 9); scope = "j" + Math.random().toString(36).substr(2, 9);
if (options.parent_type !== "array") { if (options.parent_type !== "array") {
parent_path = options.path; parent_path = options.path;
property_name = options.property_name; property_name = options.property_name;
...@@ -412,7 +412,7 @@ ...@@ -412,7 +412,7 @@
return schema_alternatives; return schema_alternatives;
}) })
.push(function (schema_alternatives) { .push(function (schema_alternatives) {
var scope = Math.random().toString(36).substr(2, 9); var scope = 's' + Math.random().toString(36).substr(2, 9);
if (schema_alternatives.length > 1) { if (schema_alternatives.length > 1) {
return gadget.declareGadget("gadget_html5_select.html", {scope: scope}) return gadget.declareGadget("gadget_html5_select.html", {scope: scope})
.push(function (g) { .push(function (g) {
...@@ -619,6 +619,7 @@ ...@@ -619,6 +619,7 @@
} }
div.appendChild(label); div.appendChild(label);
div_input = document.createElement("div"); div_input = document.createElement("div");
div_input.setAttribute("id", gadget.element.getAttribute("data-gadget-scope") + first_path + '/');
div_input.setAttribute("class", "input"); div_input.setAttribute("class", "input");
if (json_field.enum !== undefined) { if (json_field.enum !== undefined) {
......
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