From e973f2980c4dd541f53b0148604bd9706671f5e5 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 21 Nov 2016 08:26:13 -0500 Subject: [PATCH] Bug 11274 Sent Notices Tab Not Working Correctly This patch implements the notices toggle event using a different method. Using on() lets us bind the event to a parent element, allowing the event to attach to elements which may not exist on the page yet. Test plan the same as original patch: 1) have a patron with more then 20 notices sent 2) go to patron profile -> notices -> without patch, the showing/hidding of notices content does work correctly only on first loaded page -> with patch, it should work correctly everywhere - try to use paginator, searching, ordering.... Signed-off-by: Josef Moravec Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall (cherry picked from commit 6163337cd8caab98db993e4d51ac73abbdd83b86) Signed-off-by: Katrin Fischer (cherry picked from commit 9af15e2cb487280e3c4b5859a5edb77a0403c09e) Signed-off-by: Julian Maurice --- .../prog/en/modules/members/notices.tt | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt index f3f9c37cdd..4aa2ec8771 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt @@ -15,18 +15,18 @@ "sPaginationType": "four_button" })); - $(".notice").hide(); - $(".notice-title").click(function(e){ - $(this).next(".notice").toggle(); - e.preventDefault(); - }); - + $("#noticestable").on("click", ".notice-title", function(e){ + e.preventDefault(); + var rowid = $(this).data("noticeid"); + $("#notice"+rowid).toggle(); + }); + }); //]]> @@ -56,8 +56,8 @@ [% FOREACH QUEUED_MESSAGE IN QUEUED_MESSAGES %] - [% QUEUED_MESSAGE.subject %] -
+ [% QUEUED_MESSAGE.subject %] +
[% QUEUED_MESSAGE.content FILTER html_line_break %]
-- 2.39.5