Commit 9694691b authored by Boris Kocherov's avatar Boris Kocherov

Revert "getContent for empty inputs return empty string now"

This reverts commit 5ba4e004
parent f4145f9f
...@@ -1058,20 +1058,22 @@ ...@@ -1058,20 +1058,22 @@
var json_dict = {}, var json_dict = {},
k; k;
g.props.inputs.forEach(function (input) { g.props.inputs.forEach(function (input) {
if (input.type === 'number') { if (input.name === "" || input.value !== "") {
json_dict[input.name] = parseInt(input.value, 10); if (input.type === 'number') {
} else if (input.value === "true") { json_dict[input.name] = parseInt(input.value, 10);
json_dict[input.name] = true; } else if (input.value === "true") {
} else if (input.value === "false") { json_dict[input.name] = true;
json_dict[input.name] = false; } else if (input.value === "false") {
} else if (input.tagName === "TEXTAREA") { json_dict[input.name] = false;
if (input["data-format"] === "string") { } else if (input.tagName === "TEXTAREA") {
json_dict[input.name] = input.value; if (input["data-format"] === "string") {
json_dict[input.name] = input.value;
} else {
json_dict[input.name] = input.value.split('\n');
}
} else { } else {
json_dict[input.name] = input.value.split('\n'); json_dict[input.name] = input.value;
} }
} else {
json_dict[input.name] = input.value;
} }
}); });
for (k in json_dict) { for (k in json_dict) {
......
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