@@ -, +, @@ by Bug 20154 - 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. --- .../en/modules/authorities/authorities.tt | 19 ++++++++++--------- .../prog/en/modules/authorities/detail.tt | 8 ++++++++ 2 files changed, 18 insertions(+), 9 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt @@ -21,17 +21,18 @@ }); var Sticky; $(document).ready(function() { - var tabs = $('#authoritytabs').tabs().bind('show.ui-tabs', function(e, ui) { - $("#"+ui.panel.id+" input:eq(0)").focus(); - }); + var tabs = $('#authoritytabs').tabs({ + activate: function(e, ui) { + $("#"+ $(ui.newPanel).attr("id") + " input:eq(0)").focus(); + } + }); - $( "ul.sortable_field", tabs ).sortable(); - $( "ul.sortable_subfield", tabs ).sortable(); + /* On page load, check for location.hash in the page URL */ + var hash = location.hash; + var hashPieces = hash.split('?'); + var activeTab = $("[href='" + hashPieces[0] + "']"); + selectTab(activeTab); - [% IF tab %] - link = $("a[href='#[% tab | html %]']"); - selectTab( link ); - [% END %] $( "ul.sortable_field", tabs ).sortable(); $( "ul.sortable_subfield", tabs ).sortable(); Sticky = $("#toolbar"); --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt @@ -133,6 +133,14 @@ $("#authoritiestabs a:first").tab("show"); } + var editAuth = $("#editAuth"); + var editAuthLink = editAuth.attr("href"); + + $("a[data-toggle='tab']").on("shown.bs.tab", function (e) { + var newTabId = $(this).attr("href"); + editAuth.attr("href", editAuthLink + newTabId ); + }); + [% IF ( displayhierarchy ) %] $('#hierarchies').jstree({ "types" : { --