LP1920039-Bootstrap Opac: More Details button doesn't change on use.
authorGarry Collum <gcollum@gmail.com>
Thu, 13 Jan 2022 20:02:34 +0000 (15:02 -0500)
committerJason Stephenson <jason@sigio.com>
Wed, 6 Apr 2022 19:47:18 +0000 (15:47 -0400)
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>
Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2

index f55058a..7e605a6 100755 (executable)
@@ -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">