Commit 5ea34b6f authored by Boris Kocherov's avatar Boris Kocherov

cleanup

parent b1287298
...@@ -140,22 +140,19 @@ ...@@ -140,22 +140,19 @@
} }
input.appendChild(option); input.appendChild(option);
for (i = 0; i < enum_arr.length; i += 1) { for (i = 0; i < enum_arr.length; i += 1) {
if (enum_arr.hasOwnProperty(i)) { option = document.createElement("option");
option = document.createElement("option"); ser_value = JSON.stringify(enum_arr[i]);
// XXX use number id for speedup option.value = ser_value;
ser_value = JSON.stringify(enum_arr[i]); if (typeof enum_arr[i] === "string") {
option.value = ser_value; option.textContent = enum_arr[i];
if (typeof enum_arr[i] === "string") { } else {
option.textContent = enum_arr[i]; option.textContent = ser_value;
} else {
option.textContent = ser_value;
}
if (deepEqual(enum_arr[i], json_document)) {
option.selected = true;
selected = true;
}
input.appendChild(option);
} }
if (deepEqual(enum_arr[i], json_document)) {
option.selected = true;
selected = true;
}
input.appendChild(option);
} }
if (json_document !== undefined && !selected) { if (json_document !== undefined && !selected) {
// save original json_document even if it // save original json_document even if it
......
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