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:46:28 +0000 (15:46 -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 bf7b8d9..2b0533f 100755 (executable)
@@ -329,12 +329,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">