Bug 33278: Correct JS for activating default tab on various pages
authorOwen Leonard <oleonard@myacpl.org>
Mon, 20 Mar 2023 15:43:39 +0000 (15:43 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Mon, 27 Mar 2023 09:51:00 +0000 (11:51 +0200)
The conversion of the header search tabs to Bootstrap resulted in a bug
on several staff interface pages: The first tab isn't selected by
default. The jQuery selector isn't specific enough.

The patch also corrects a template error which was introduced to
merge-record.inc by Bug 32683.

To test, apply the patch and test the following pages to confirm that
the first tab on each page is selected by default:

- Catalog -> Advanced search
- Catalog -> MARC details
- Catalog -> Search results -> Merge
- Administration -> Authorized values -> Edit
- Administratoin -> Library transfer limits
- Administration -> Item types -> Edit
- Authorities -> Authority details
- Authorities -> Search -> Merge

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/en/includes/merge-record.inc
koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/branch_transfer_limits.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt
koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/MARCdetail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.tt

index c7da8bf..260d328 100644 (file)
@@ -48,7 +48,6 @@
     <div id="tabs" class="toptabs">
         <h2>Source records</h2>
         <ul class="nav nav-tabs" role="tablist">
-    <div class="tab-content">
             [% FOREACH record IN sourcerecords %]
                 <li role="presentation">
                     <a href="#tabrecord[% record.recordid | uri %]" aria-controls="tabrecord[% record.recordid | uri %]" role="tab" data-toggle="tab">
index 1e06bbc..9a26c45 100644 (file)
                 return confirm(_("Are you sure you want to delete this authorized value category?"));
             });
 
-            if( $(".tab-pane.active").length < 1 ){
+            if( $("#icons .tab-pane.active").length < 1 ){
                 $("#icons a:first").tab("show");
             }
         });
index 478452f..aaa459d 100644 (file)
                 });
             });
 
-            if( $(".tab-pane.active").length < 1 ){
+            if( $("#transferlimit_tabs .tab-pane.active").length < 1 ){
                   $("#transferlimit_tabs a:first").tab("show");
             }
 
index ee95cd7..a91de39 100644 (file)
@@ -643,7 +643,7 @@ Item types &rsaquo; Administration &rsaquo; Koha
                 toUC(this);
             });
             $(".library_limitation").tooltip();
-            if( $(".tab-pane.active").length < 1 ){
+            if( $("#icons .tab-pane.active").length < 1 ){
                 $("#icons a:first").tab("show");
             }
          });
index 5664c53..83a1e06 100644 (file)
     [% END %]
     <script>
         $(document).ready(function() {
-            if( $(".tab-pane.active").length < 1 ){
+            if( $("#authoritiestabs .tab-pane.active").length < 1 ){
                 $("#authoritiestabs a:first").tab("show");
             }
 
index 7feeb2b..1389e67 100644 (file)
@@ -149,7 +149,7 @@ div#result { margin-top: 1em; }
             ev.preventDefault();
             newin=window.open($(this).attr('href'),'merge_reference', 'width=1000,height=600,toolbar=false,scrollbars=yes');
         });
-        if( $(".tab-pane.active").length < 1 ){
+        if( $("#tabs .tab-pane.active").length < 1 ){
             $("#tabs a:first").tab("show");
         }
     });
index 5628c20..0996fa9 100644 (file)
             $("#Frameworks").on("change",function(){
                 Changefwk(this);
             });
-            if( $(".tab-pane.active").length < 1 ){
+            if( $("#bibliotabs .tab-pane.active").length < 1 ){
                 $("#bibliotabs a:first").tab("show");
             }
         });
index f966029..84931e7 100644 (file)
         var Sticky;
         $(document).ready(function() {
             $("input[name=q]:eq(0)").focus();
-            if( $(".tab-pane.active").length < 1 ){
+            if( $("#advsearches .tab-pane.active").length < 1 ){
                 $("#advsearches a:first").tab("show");
             }
             Sticky = $("#toolbar");
index b04a327..9e31766 100644 (file)
@@ -293,7 +293,7 @@ div#result { margin-top: 1em; }
               rebuild_target($("#tabs"), $("#resultul"));
             });
 
-            if( $(".tab-pane.active").length < 1 ){
+            if( $("#tabs .tab-pane.active").length < 1 ){
                 $("#tabs a:first").tab("show");
             }