Commit a718881c authored by Boris Kocherov's avatar Boris Kocherov

remove title serialization for string in enum

parent c3c0d511
...@@ -119,7 +119,11 @@ ...@@ -119,7 +119,11 @@
// XXX use number id for speedup // XXX use number id for speedup
ser_value = JSON.stringify(enum_arr[i]); ser_value = JSON.stringify(enum_arr[i]);
option.value = ser_value; option.value = ser_value;
if (typeof enum_arr[i] === "string") {
option.textContent = enum_arr[i];
} else {
option.textContent = ser_value; option.textContent = ser_value;
}
if (enum_arr[i] === json_document) { if (enum_arr[i] === json_document) {
option.selected = true; option.selected = true;
selected = true; selected = true;
...@@ -134,7 +138,11 @@ ...@@ -134,7 +138,11 @@
option = document.createElement("option"); option = document.createElement("option");
ser_value = JSON.stringify(json_document); ser_value = JSON.stringify(json_document);
option.value = ser_value; option.value = ser_value;
if (typeof json_document === "string") {
option.textContent = json_document;
} else {
option.textContent = ser_value; option.textContent = ser_value;
}
option.selected = true; option.selected = true;
input.appendChild(option); input.appendChild(option);
} }
......
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