From a25ead04261ede2aab1461b7dcfb3a2c5af325d7 Mon Sep 17 00:00:00 2001 From: Paul Derscheid Date: Mon, 28 Oct 2024 14:39:23 +0000 Subject: [PATCH] Bug 33178: (QA follow-up) Reformat js changes Signed-off-by: Katrin Fischer --- .../modules/admin/auth_subfields_structure.tt | 18 +++++++++--------- .../prog/js/marc_subfields_structure.js | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt index 2affbe6a93..571ae059e9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt @@ -418,7 +418,7 @@ paginate: false })); - if( $("#subfieldtabs").length > 0 ){ + if ($("#subfieldtabs").length > 0) { [% IF ( tagsubfield && tagsubfield == "@") %] $("#subfieldtabs a[href='#AT_panel']").tab("show"); [% ELSIF ( tagsubfield && tagsubfield != "@") %] @@ -428,20 +428,20 @@ [% END %] var subfields_list = $("#subfieldtabs > ul"); - var sortable_subfields = new Sortable( subfields_list[0], { - onEnd: function( e ){ + var sortable_subfields = new Sortable(subfields_list[0], { + onEnd: function (e) { var old_index = e.oldIndex; var new_index = e.newIndex; if (old_index < new_index) new_index++; - var subfield_code = e.item.id.replace( /^tab_subfield_/, ''); - var content = $( '#' + subfield_code + '_panel'); + var subfield_code = e.item.id.replace(/^tab_subfield_/, ""); + var content = $("#" + subfield_code + "_panel"); var panels = $("#subfieldtabs .tab-pane"); - if ( new_index < $(panels).size() ){ - $(content).insertBefore( panels[new_index]); + if (new_index < $(panels).size()) { + $(content).insertBefore(panels[new_index]); } else { - $(content).insertAfter( panels[new_index-1]); + $(content).insertAfter(panels[new_index - 1]); } - } + }, }); } diff --git a/koha-tmpl/intranet-tmpl/prog/js/marc_subfields_structure.js b/koha-tmpl/intranet-tmpl/prog/js/marc_subfields_structure.js index fb164b4c11..7c8c4988a6 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/marc_subfields_structure.js +++ b/koha-tmpl/intranet-tmpl/prog/js/marc_subfields_structure.js @@ -15,7 +15,7 @@ $(document).ready(function() { var new_index = e.newIndex; if (old_index < new_index) new_index++; var subfield_code = e.item.id.replace( /^tab_subfield_/, ''); - var content = $( '#' + subfield_code + '_panel'); + var content = $("#" + subfield_code + "_panel"); var panels = $("#subfieldtabs .tab-pane"); if ( new_index < $(panels).size() ){ $(content).insertBefore( panels[new_index]); -- 2.39.5