mirror of
https://github.com/Mintplex-Labs/express-admin.git
synced 2026-07-21 00:45:22 -04:00
Fix for inlines with file controls in them
This commit is contained in:
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user