1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-19 13:01:26 +02:00

Update the clone/copy repeater item function to also account for InputfieldTable rows that may be present in the repeater

This commit is contained in:
Ryan Cramer
2018-08-19 07:01:54 -04:00
parent 5554e87b47
commit ff123065eb
2 changed files with 6 additions and 1 deletions

View File

@@ -347,6 +347,11 @@ function InputfieldRepeater($) {
initRepeater($addItem); initRepeater($addItem);
$addItem.unwrap(); // unwrap div once item initialized $addItem.unwrap(); // unwrap div once item initialized
$addItem.find('.Inputfield').trigger('reloaded', [ 'InputfieldRepeaterItemAdd' ]); $addItem.find('.Inputfield').trigger('reloaded', [ 'InputfieldRepeaterItemAdd' ]);
if(cloneID) {
$addItem.find('.Inputfield').trigger('cloned', [ 'InputfieldRepeaterItemAdd' ]);
// next line can remove 9/2019, as 'cloned' support will have been in InputfieldTable for awhile
$addItem.find('.InputfieldTableRowID').val(0);
}
$addItem.find('.InputfieldRepeaterSort').val($inputfields.children().length); $addItem.find('.InputfieldRepeaterSort').val($inputfields.children().length);
$('html, body').animate({ $('html, body').animate({
scrollTop: $addItem.offset().top scrollTop: $addItem.offset().top

File diff suppressed because one or more lines are too long