From ec32f4c330c4a3067a5276a38987a366ff606631 Mon Sep 17 00:00:00 2001 From: Garry Collum <gcollum@gmail.com> Date: Thu, 13 Jan 2022 15:02:34 -0500 Subject: [PATCH] LP1920039-Bootstrap Opac: More Details button doesn't change on use. The 'More Details' button in a bib record in the Bootstrap Opac should change to say 'Less Details' when pressed. This patch fixes that behavior. To Test. 1. Go to a bib record in the boostrap opac. 2. Press "More Details" 3. Notice the button still displays "More Details" 4. Apply the patch and repeat. 5. The button should now toggle between "More Details" and "Less Details" Signed-off-by: Garry Collum <gcollum@gmail.com> Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org> Signed-off-by: John Amundson <jamundson@cwmars.org> Signed-off-by: Jason Stephenson <jason@sigio.com> --- .../src/templates-bootstrap/opac/parts/record/summary.tt2 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 index f55058a213..7e605a61e9 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 @@ -328,12 +328,15 @@ ctx.metalinks.push(' </div> </div> - <script>jQuery('#demo').on('hidden.bs.collapse', function () { - jQuery('#btnMore').html("<i class='fas fa-info-circle' aria-hidden='true'></i> [%l ('More Details') %]"); - }) - jQuery('#demo').on('shown.bs.collapse', function () { - jQuery('#btnMore').html("<i class='fas fa-info-circle' aria-hidden='true'></i> [%l ('Fewer Details') %]"); - }) + <script> + $(document).ready(function() { + $('#demo').on('hidden.bs.collapse', function () { + $('#btnMore').html("<i class='fas fa-info-circle' aria-hidden='true'></i> [%l ('More Details') %]"); + }) + $('#demo').on('shown.bs.collapse', function () { + $('#btnMore').html("<i class='fas fa-info-circle' aria-hidden='true'></i> [%l ('Fewer Details') %]"); + }) + }); </script> <div id="copy_hold_counts"> -- 2.11.0