Skip to content

Commit

Permalink
Bugfix: XMLParser children in ie #369, date form-control class #351 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchappell authored Feb 22, 2017
1 parent 74c1c35 commit aa4216b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
10 changes: 3 additions & 7 deletions demo/assets/js/form-builder.min.js

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions demo/assets/js/form-render.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demo/assets/js/form-render.min.js.map

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion src/js/form-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,13 @@

field.name = isNew ? nameAttr(field) : ( field.name || nameAttr(field) );

if (isNew && utils.inArray(field.type, ['text', 'number', 'file', 'select', 'textarea'])) {
if (isNew && utils.inArray(field.type, [
'text',
'number',
'file',
'date',
'select',
'textarea'])) {
field.className = 'form-control'; // backwards compatibility
} else {
field.className = field.class || field.className; // backwards compatibility
Expand Down
3 changes: 2 additions & 1 deletion src/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,9 @@ fbUtils.parseXML = function(xmlString) {
var fields = xml.getElementsByTagName('field');
for (var i = 0; i < fields.length; i++) {
let fieldData = fbUtils.parseAttrs(fields[i]);
let nodeChildren = fields[i].children || [];

if (fields[i].children && fields[i].children.length) {
if (nodeChildren.length) {
fieldData.values = fbUtils.parseOptions(fields[i]);
}

Expand Down

0 comments on commit aa4216b

Please sign in to comment.