View | Details | Raw Unified | Return to bug 33178
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/auth_subfields_structure.tt (-9 / +9 lines)
Lines 418-424 Link Here
418
                paginate: false
418
                paginate: false
419
            }));
419
            }));
420
420
421
            if( $("#subfieldtabs").length > 0 ){
421
            if ($("#subfieldtabs").length > 0) {
422
                [% IF ( tagsubfield && tagsubfield == "@") %]
422
                [% IF ( tagsubfield && tagsubfield == "@") %]
423
                    $("#subfieldtabs a[href='#AT_panel']").tab("show");
423
                    $("#subfieldtabs a[href='#AT_panel']").tab("show");
424
                [% ELSIF ( tagsubfield && tagsubfield != "@") %]
424
                [% ELSIF ( tagsubfield && tagsubfield != "@") %]
Lines 428-447 Link Here
428
                [% END %]
428
                [% END %]
429
429
430
                var subfields_list = $("#subfieldtabs > ul");
430
                var subfields_list = $("#subfieldtabs > ul");
431
                var sortable_subfields = new Sortable( subfields_list[0], {
431
                var sortable_subfields = new Sortable(subfields_list[0], {
432
                    onEnd: function( e ){
432
                    onEnd: function (e) {
433
                        var old_index = e.oldIndex;
433
                        var old_index = e.oldIndex;
434
                        var new_index = e.newIndex;
434
                        var new_index = e.newIndex;
435
                        if (old_index < new_index) new_index++;
435
                        if (old_index < new_index) new_index++;
436
                        var subfield_code = e.item.id.replace( /^tab_subfield_/, '');
436
                        var subfield_code = e.item.id.replace(/^tab_subfield_/, "");
437
                        var content = $( '#' + subfield_code + '_panel');
437
                        var content = $("#" + subfield_code + "_panel");
438
                        var panels = $("#subfieldtabs .tab-pane");
438
                        var panels = $("#subfieldtabs .tab-pane");
439
                        if ( new_index < $(panels).size() ){
439
                        if (new_index < $(panels).size()) {
440
                            $(content).insertBefore( panels[new_index]);
440
                            $(content).insertBefore(panels[new_index]);
441
                        } else {
441
                        } else {
442
                            $(content).insertAfter( panels[new_index-1]);
442
                            $(content).insertAfter(panels[new_index - 1]);
443
                        }
443
                        }
444
                    }
444
                    },
445
                });
445
                });
446
            }
446
            }
447
447
(-)a/koha-tmpl/intranet-tmpl/prog/js/marc_subfields_structure.js (-2 / +1 lines)
Lines 15-21 $(document).ready(function() { Link Here
15
            var new_index = e.newIndex;
15
            var new_index = e.newIndex;
16
            if (old_index < new_index) new_index++;
16
            if (old_index < new_index) new_index++;
17
            var subfield_code = e.item.id.replace( /^tab_subfield_/, '');
17
            var subfield_code = e.item.id.replace( /^tab_subfield_/, '');
18
            var content = $( '#' + subfield_code + '_panel');
18
            var content = $("#" + subfield_code + "_panel");
19
            var panels = $("#subfieldtabs .tab-pane");
19
            var panels = $("#subfieldtabs .tab-pane");
20
            if ( new_index < $(panels).size() ){
20
            if ( new_index < $(panels).size() ){
21
                $(content).insertBefore( panels[new_index]);
21
                $(content).insertBefore( panels[new_index]);
22
- 

Return to bug 33178