Fix for inlines with file controls in them

This commit is contained in:
simov
2013-11-29 15:12:42 +02:00
parent 77fa912c79
commit f353fef3c9
+9
View File
@@ -37,6 +37,10 @@ Date.prototype.toJSONLocal = function() {
if ($('.form-group .form-control', self).length)
return $('.form-group .form-control', self);
}
function getFileControl (self) {
if ($('.form-group [type=file]', self).length)
return $('.form-group [type=file]', self);
}
return {
inlines: function () {
$('.add-another').on('click', function (e) {
@@ -55,6 +59,11 @@ Date.prototype.toJSONLocal = function() {
name = control.attr('name') || '';
control.attr('name',
name.replace('blank', 'records').replace('index', index));
var fileControl = getFileControl(this);
if (fileControl)
fileControl.attr('name',
name.replace('blank', 'records').replace('index', index));
});
// set keys for insert
(function () {