mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-15 09:46:06 +01:00
Fixes js button issue https://github.com/getgrav/grav-plugin-admin/issues/270
This commit is contained in:
@@ -472,9 +472,17 @@ $(function () {
|
||||
|
||||
newItem.attr('data-collection-item', newItem.attr('data-collection-item').replace('*', key));
|
||||
newItem.attr('data-collection-key', key);
|
||||
newItem.find('[name]').each(function () {
|
||||
$(this).attr('name', $(this).attr('name').replace('*', key));
|
||||
});
|
||||
|
||||
var replaceAttribute = function replaceAttribute(attribute) {
|
||||
newItem.find('[' + attribute + ']').each(function () {
|
||||
$(this).attr(attribute, $(this).attr(attribute).replace('*', key));
|
||||
});
|
||||
};
|
||||
|
||||
replaceAttribute('name');
|
||||
replaceAttribute('data-grav-field-name');
|
||||
replaceAttribute('id');
|
||||
replaceAttribute('for');
|
||||
|
||||
holder.append(newItem);
|
||||
button.data('key-index', ++key);
|
||||
|
||||
Reference in New Issue
Block a user