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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc (-15 / +20 lines)
Lines 120-125 Link Here
120
            }
120
            }
121
        }
121
        }
122
122
123
        function update_columns_visibility(settings){
124
            let table = settings.oInstance.api();
125
            table.columns().visible(true);
126
            table.columns().every(function(i){
127
                let is_empty = true;
128
                let nodes = this.nodes();
129
                nodes.each((td, ii) => {
130
                    if ( $(td).html() !== '' ) {
131
                        is_empty = false;
132
                        return;
133
                    }
134
                });
135
                if ( is_empty ) {
136
                    table.columns(i).visible(false);
137
                }
138
            });
139
        }
140
123
        $(document).ready(function() {
141
        $(document).ready(function() {
124
142
125
            $(".SelectAll").on("click",function(e){
143
            $(".SelectAll").on("click",function(e){
Lines 779-798 Link Here
779
            [% END %]
797
            [% END %]
780
            ],
798
            ],
781
            initComplete: function( settings, json ){
799
            initComplete: function( settings, json ){
782
                let table = settings.oInstance.api();
783
                table.columns().every(function(i){
784
                    let is_empty = true;
785
                    let nodes = this.nodes();
786
                    nodes.each((td, ii) => {
787
                        if ( $(td).html() !== '' ) {
788
                            is_empty = false;
789
                            return;
790
                        }
791
                    });
792
                    if ( is_empty ) {
793
                        table.columns(i).visible(false);
794
                    }
795
                });
796
                [% IF StaffDetailItemSelection %]
800
                [% IF StaffDetailItemSelection %]
797
                itemSelectionBuildActionLinks(tab_id);
801
                itemSelectionBuildActionLinks(tab_id);
798
                [% END %]
802
                [% END %]
Lines 835-840 Link Here
835
                    });
839
                    });
836
                [% END %]
840
                [% END %]
837
841
842
                update_columns_visibility(settings);
843
838
                if ( drawcallback ) { drawcallback(this); }
844
                if ( drawcallback ) { drawcallback(this); }
839
            },
845
            },
840
            [% END %]
846
            [% END %]
841
- 

Return to bug 38118