From fa87fd8946d9cef103d66d9d1dbb34250c34e0f0 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 27 Jun 2022 14:54:42 +0100 Subject: [PATCH] Bug 28854: (follow-up) Make 'Manage bundle' button a 'toggle' This patch adds and removes the 'active' class to the 'Manage bundle' button such that it correctly reflects whether the manage area is expanded or not for the bundle item. --- .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index e362ac3bb1..6fc238e5c2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1743,8 +1743,9 @@ Note that permanent location is a code, and location may be an authval. [% IF bundlesEnabled %] // Add event listener for opening and closing bundle details $('#' + table_name + ' tbody').on('click', 'button.details-control', function () { - var tr = $(this).closest('tr'); - var dTable = $(this).closest('table').DataTable({ 'retrieve': true }); + var button = $(this); + var tr = button.closest('tr'); + var dTable = button.closest('table').DataTable({ 'retrieve': true }); var itemnumber = tr.data('itemnumber'); var duedate = tr.data('duedate'); @@ -1754,11 +1755,13 @@ Note that permanent location is a code, and location may be an authval. // This row is already open - close it row.child.hide(); tr.removeClass('shown'); + button.removeClass('active'); } else { // Open this row createChild(row, itemnumber, duedate); tr.addClass('shown'); + button.addClass('active'); } } ); [% END %] -- 2.20.1