mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-18 11:10:56 +01:00
Fixed issue with lists and id and for attributes not getting reindexed
This commit is contained in:
@@ -69,6 +69,7 @@ export default class CollectionsField {
|
||||
item.find('[' + prop + ']').each(function() {
|
||||
let element = $(this);
|
||||
let indexes = [];
|
||||
|
||||
element.parents('[data-collection-key]').map((idx, parent) => indexes.push($(parent).attr('data-collection-key')));
|
||||
indexes.reverse();
|
||||
|
||||
@@ -76,10 +77,13 @@ export default class CollectionsField {
|
||||
return `[${indexes.shift()}]`;
|
||||
});
|
||||
|
||||
replaced = element.attr(prop).replace(/\.(\d+|\*)\./g, (/* str, p1, offset */) => {
|
||||
return `.${indexes.shift()}.`;
|
||||
});
|
||||
|
||||
element.attr(prop, replaced);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
4
themes/grav/js/admin.min.js
vendored
4
themes/grav/js/admin.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user