From 0d0ec2d414ffd37ddaac67b94e8406ba6bcd245f Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 24 Mar 2020 12:14:21 +0000 Subject: [PATCH] Bug 16457: (follow-up) Enable click event on dynamically-created elements This patch moves the click handler for patron attribute actions ("new", "clear") from the links themselves to the container. This allows jQuery to correctly target dynamically-created copies of the links. To test you should have extended patron attributes enabled and you should have some repeatable attributes defined. - Create or edit a patron record - In the "Additional attributes and identifiers" section, test the "Clear" and "New" links. Confirm that the controls work with both the original instance of the field and those created by clicking "New." Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- .../intranet-tmpl/prog/en/modules/members/memberentrygen.tt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index d21a4af434..89fe78f993 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -1650,12 +1650,12 @@ legend:hover { $('#debarred_expiration').val(""); }); - $(".clear_attribute").on("click", function(e){ + $("#memberentry_patron_attributes").on("click", ".clear_attribute", function(e){ e.preventDefault(); clear_entry( this ); }); - $(".clone_attribute").on("click", function(e){ + $("#memberentry_patron_attributes").on("click", ".clone_attribute", function(e){ e.preventDefault(); clone_entry( this ); }); -- 2.39.5