Skip to content

Commit

Permalink
Fixed bug with required attributes inside of lists
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed Dec 10, 2015
1 parent 824f502 commit cb68cdd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions assets/js/be_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ var newElementAtPosition = function(listElement, position) {
newItem.set('data-rsce-name', newKey);

var newItemHtml = dummyItem.get('html')
.split(' data-rsce-required="data-rsce-required"')
.join(' required="required"')
.split(key + '__rsce_dummy')
.join(newKey);
newItem.set('html', newItemHtml);
Expand Down Expand Up @@ -501,6 +503,10 @@ var initList = function(listElement) {

var dummyFields = [];
listElement.getElements('[name*="__rsce_dummy__"]').each(function(input) {
if (input.required) {
input.required = false;
input.setProperty('data-rsce-required', 'data-rsce-required');
}
dummyFields.push(input.get('name').split('[')[0]);
});
removeFormFields(
Expand Down

0 comments on commit cb68cdd

Please sign in to comment.