Skip to content

Commit

Permalink
Bugfix: Cannot render multiple (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchappell authored Aug 17, 2016
1 parent 435cbd4 commit ce858e6
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion 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.

15 changes: 7 additions & 8 deletions dist/form-render.js
Original file line number Diff line number Diff line change
Expand Up @@ -441,18 +441,17 @@ function FormRenderFn(options, element) {

if (opts.render) {
if (opts.container) {
var renderedFormWrap = _helpers.markup('div', rendered, { className: 'rendered-form' });
var _renderedFormWrap = _helpers.markup('div', rendered, { className: 'rendered-form' });
opts.container = opts.container instanceof jQuery ? opts.container[0] : opts.container;
opts.container.emptyContainer();
opts.container.appendChild(renderedFormWrap);
opts.container.appendChild(_renderedFormWrap);
} else if (element) {
var _renderedFormWrap = document.querySelector('.rendered-form');
if (_renderedFormWrap) {
_renderedFormWrap.emptyContainer();
_renderedFormWrap.appendFormFields(rendered);
if (element.parentElement.classList.contains('rendered-form')) {
renderedFormWrap.emptyContainer();
renderedFormWrap.appendFormFields(rendered);
} else {
_renderedFormWrap = _helpers.markup('div', rendered, { className: 'rendered-form' });
element.parentNode.insertBefore(_renderedFormWrap, element.nextSibling);
var _renderedFormWrap2 = _helpers.markup('div', rendered, { className: 'rendered-form' });
element.parentNode.insertBefore(_renderedFormWrap2, element.nextSibling);
element.style.display = 'none';
element.setAttribute('disabled', 'disabled');
}
Expand Down
Loading

0 comments on commit ce858e6

Please sign in to comment.