@@ -, +, @@ - When the page first displays, the "0" tab should be active. - Test that each of the numbered tabs works correctly to activate the correct tab content. - Confirm that the numbered tag anchors still work correctly. - Append a specific tab anchor to the URL, e.g. "#tab4XX" and refresh the page (you may need to shift-refresh). When the page reloads the correct tab should be active by default. - Confirm that sortable subfields can still be re-ordered by dragging and dropping them via the "stacked lines" icons. --- .../intranet-tmpl/prog/css/addbiblio.css | 14 +- .../en/modules/authorities/authorities.tt | 432 +++++++++--------- 2 files changed, 224 insertions(+), 222 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css +++ a/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css @@ -6,17 +6,23 @@ div#toolbar { border: 0; } -#addbibliotabs .ui-tabs-nav, -#authoritytabs .ui-tabs-nav { +#addbibliotabs .ui-tabs-nav { display: none; } -.ui-tabs-panel h3 { +.tab-content { + border: 0; + padding: 0; +} + +.ui-tabs-panel h3, +.tab-pane h3 { font-size: 140%; margin: .3em 0; } -.ui-tabs-panel ul { +.ui-tabs-panel ul, +.tab-pane ul { margin-bottom: 0; padding-left: 0; } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt @@ -21,23 +21,23 @@ }); var Sticky; $(document).ready(function() { - var tabs = $('#authoritytabs').tabs({ - activate: function(e, ui) { - $("#"+ $(ui.newPanel).attr("id") + " .input_marceditor:visible:eq(0)").focus(); - } - }); + + $("a[data-toggle='tab']").on("shown.bs.tab", function (e) { + $( e.target.hash + " .input_marceditor:visible:eq(0)").focus(); + }); /* On page load, check for location.hash in the page URL */ + /* If present the location hash will be used to activate the correct tab */ var hash = location.hash; var hashPieces = hash.split('?'); if( hashPieces[0] !== "" ){ - var activeTab = $("[href='" + hashPieces[0] + "']"); - selectTab(activeTab); + selectTab( hashPieces[0] ); window.scrollTo( 0, 0 ); } - $( "ul.sortable_field", tabs ).sortable(); - $( "ul.sortable_subfield", tabs ).sortable(); + $( "ul.sortable_field", "#authoritytabs" ).sortable(); + $( "ul.sortable_subfield", "#authoritytabs" ).sortable(); + Sticky = $("#toolbar"); Sticky.hcSticky({ stickTo: ".main", @@ -56,10 +56,6 @@ } return false; }); - $(".toolbar-tabs a").on("click",function(e){ - e.preventDefault(); - selectTab( $(this ) ); - }); $(".tag_anchor").on("click", function(e){ e.preventDefault(); @@ -81,10 +77,10 @@ }); function selectTab( tablink ){ + let a = $("a[href='" + tablink + "']"); $(".toolbar-tabs li").removeClass("selected"); - tablink.parent().addClass("selected"); - var tabid = tablink.data("tabid"); - $('#authoritytabs').selectTabByID("#tab" + tabid + "XX"); + a.tab("show").parent().addClass("selected"); + var tabid = a.data("tabid"); $(".tag_anchors").removeClass("tab_selected").hide(); $(".tag_anchors_" + tabid ).addClass("tab_selected").show(); } @@ -330,14 +326,14 @@