Bug 36882: Reapply flatpickr to cloned entry

1) Add a patron attribute type:
   http://localhost:8081/cgi-bin/koha/admin/patron-attr-types.pl?op=add_attribute_type
2) Make sure its repeatable + is_date
3) Visit overdues:
   http://localhost:8081/cgi-bin/koha/circ/overdue.pl
4) Click the 'add' button under the date custom attribute
5) Click on the newly created input, notice the flatpickr pop up doesnt
   show
6) Apply patch. Repeat.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 4c3ef3b69d)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Pedro Amorim 2024-05-16 11:46:08 +00:00 committed by Lucas Gass
parent 4f9707dcd1
commit c38db96f3d
1 changed files with 4 additions and 0 deletions

View File

@ -305,6 +305,10 @@
clone.find(".select2").remove();
original.after( clone );
$("#" + appendid ).select2();
} else if( clone.find(".flatpickr").length ){
clone.attr("id", appendid );
original.after( clone );
apply_flatpickr(clone.find(".flatpickr"));
} else {
clone.attr("id", appendid );
original.after( clone );