LP1920039-Bootstrap Opac: More Details button doesn't change on use. user/gcollum/lp1920039_bootstrap_opac_more_or_less_details_button
authorGarry Collum <gcollum@gmail.com>
Thu, 13 Jan 2022 20:02:34 +0000 (15:02 -0500)
committerGarry Collum <gcollum@gmail.com>
Thu, 13 Jan 2022 20:02:34 +0000 (15:02 -0500)
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>
Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2

index a0007ed..30a43d6 100755 (executable)
@@ -324,12 +324,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> More Details");
-                    })
-                    jQuery('#demo').on('shown.bs.collapse', function () {
-                        jQuery('#btnMore').html("<i class='fas fa-info-circle' aria-hidden='true'></i> Less Details");
-                    })
+                <script>
+                    $(document).ready(function() {
+                        $('#demo').on('hidden.bs.collapse', function () {
+                            $('#btnMore').html("<i class='fas fa-info-circle' aria-hidden='true'></i> More Details");
+                        })
+                        $('#demo').on('shown.bs.collapse', function () {
+                            $('#btnMore').html("<i class='fas fa-info-circle' aria-hidden='true'></i> Less Details");
+                        })
+                    });
                     </script>
 
                <div id="copy_hold_counts">