Bug 20154: Stay in the open tab when editing authority record
authorOwen Leonard <oleonard@myacpl.org>
Mon, 13 Jul 2020 20:09:17 +0000 (20:09 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 13 Aug 2020 05:55:45 +0000 (07:55 +0200)
This patch adds some JavaScript to the authority record detail page in
the staff interface so that clicking "Edit" will take you to the
authority edit page while keeping the same tab open.

To test, apply the patch and locate an authority record in your catalog.

 - Click any of the numbered tabs besides tab 0.
 - Choose "Edit record" from the "Edit" dropdown menu.
 - When the authorities edit page loads the same tab should be
   preselected.

Signed-off-by: Marjorie <marjorie.barry-vila@collecto.ca>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt

index 618e325..c06d753 100644 (file)
     [% END %]
     <script>
         $(document).ready(function() {
-            $('#authoritiestabs').tabs();
+            var editAuth = $("#editAuth");
+            var editAuthLink = editAuth.attr("href");
+            $('#authoritiestabs').tabs({
+                activate: function( event, ui ){
+                    editAuth.attr("href", editAuthLink + "#" + ui.newPanel.attr('id') );
+                }
+            });
             [% IF ( displayhierarchy ) %]
                 var current_nodes = [];
                 $('.currentauth').each(function() {