Skip to content

Commit

Permalink
fix #83
Browse files Browse the repository at this point in the history
  • Loading branch information
idelvall committed May 4, 2017
1 parent 075d566 commit d0fa10a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions dist/js/brutusin-json-forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ if (typeof brutusin === "undefined") {
input = document.createElement("input");
if (s.type === "integer" || s.type === "number") {
input.type = "number";
input.step = "any";
input.step = s.step?""+s.step:"any";
if (typeof value !== "number") {
value = null;
}
Expand Down Expand Up @@ -358,13 +358,13 @@ if (typeof brutusin === "undefined") {

var optionTrue = document.createElement("option");
var textTrue = document.createTextNode(BrutusinForms.messages["true"]);
textTrue.value = "true";
optionTrue.value = "true";
appendChild(optionTrue, textTrue, s);
appendChild(input, optionTrue, s);

var optionFalse = document.createElement("option");
var textFalse = document.createTextNode(BrutusinForms.messages["false"]);
textFalse.value = "false";
optionFalse.value = "false";
appendChild(optionFalse, textFalse, s);
appendChild(input, optionFalse, s);

Expand Down Expand Up @@ -1251,7 +1251,8 @@ if (typeof brutusin === "undefined") {
return input.getValue();
}
var value;
if (schema.enum) {

if (input.tagName.toLowerCase() === "select") {
value = input.options[input.selectedIndex].value;
} else {
value = input.value;
Expand Down
Loading

0 comments on commit d0fa10a

Please sign in to comment.