diff --git a/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css b/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css index 4411026906..9bc49c9b6c 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css +++ b/koha-tmpl/intranet-tmpl/prog/css/addbiblio.css @@ -6,22 +6,16 @@ div#toolbar { border: 0; } -#addbibliotabs .ui-tabs-nav { - display: none; -} - .tab-content { border: 0; padding: 0; } -.ui-tabs-panel h3, .tab-pane h3 { font-size: 140%; margin: .3em 0; } -.ui-tabs-panel ul, .tab-pane ul { margin-bottom: 0; padding-left: 0; @@ -276,11 +270,6 @@ tbody tr.active td { width: 15em; } -.ui-tabs .ui-tabs-panel { - border: 0; - padding: 0; -} - .toolbar-tabs-container { margin: 3em -5px -5px -5px; } @@ -461,7 +450,3 @@ tbody tr.active td { padding: 0; } -#authoritiestabs .ui-tabs-nav.ui-widget-header { - border-bottom: 1px solid #b9d8d9; - border-radius: 0; -} diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt index cb6a16f905..10ec159911 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -32,21 +32,31 @@ $("#toolbar").hide(); [% END %] - var $tabs = $('#addbibliotabs').tabs().bind('show.ui-tabs', function(e, ui) { - $("#"+ui.panel.id+" input:eq(0)").focus(); + $("a[data-toggle='tab']").on("shown.bs.tab", function (e) { + $( e.target.hash + " .input_marceditor:visible:eq(0)").focus(); }); - $( "ul.sortable_field", $tabs ).sortable({ + + /* 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] !== "" ){ + selectTab( hashPieces[0] ); + window.scrollTo( 0, 0 ); + } + + $( "ul.sortable_field", "#addbibliotabs" ).sortable({ axis: "y", containment: $("#addbibliotabs") }); - $( "ul.sortable_subfield", $tabs ).sortable({ + $( "ul.sortable_subfield", "#addbibliotabs" ).sortable({ axis: "y", containment: "parent" }); [% IF tab %] - link = $("a[href='#[% tab | html %]']"); - selectTab( link ); + hash = "#[% tab | html %]"; + selectTab( hash ); [% END %] Sticky = $("#toolbar"); @@ -151,7 +161,7 @@ $(".toolbar-tabs a").on("click",function(e){ e.preventDefault(); - selectTab( $(this ) ); + selectTab( this.hash ); }); $(".tag_anchor").on("click", function(e){ @@ -179,10 +189,10 @@ }); function selectTab( tablink ){ + let a = $("a[href='" + tablink + "']"); $(".toolbar-tabs li").removeClass("selected"); - tablink.parent().addClass("selected"); - var tabid = tablink.data("tabid"); - $('#addbibliotabs').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(); } @@ -950,14 +960,14 @@ function PopupMARCFieldDoc(field) { [% END # /UNLESS circborrowernumber %]