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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc (-3 / +5 lines)
Lines 145-151 Link Here
145
                tab.find(".show_filters").hide();
145
                tab.find(".show_filters").hide();
146
                tab.find(".hide_filters").show();
146
                tab.find(".hide_filters").show();
147
                $("#"+tab_id+"_table thead tr:eq(1)").remove();
147
                $("#"+tab_id+"_table thead tr:eq(1)").remove();
148
                build_items_table(tab_id, true, { destroy: true } );
148
                build_items_table(tab_id, true, { destroy: true }, build_items_table_drawncallback );
149
            });
149
            });
150
150
151
            $(".hide_filters").on("click",function(e){
151
            $(".hide_filters").on("click",function(e){
Lines 155-161 Link Here
155
                tab.find(".hide_filters").hide();
155
                tab.find(".hide_filters").hide();
156
                tab.find(".show_filters").show();
156
                tab.find(".show_filters").show();
157
                $("#"+tab_id+"_table thead tr:eq(1)").remove();
157
                $("#"+tab_id+"_table thead tr:eq(1)").remove();
158
                build_items_table(tab_id, false, { destroy: true } );
158
                build_items_table(tab_id, false, { destroy: true }, build_items_table_drawncallback );
159
            });
159
            });
160
        });
160
        });
161
    [% END %]
161
    [% END %]
Lines 218-224 Link Here
218
        holdings: '[% PROCESS 'build_table' tab="holdings" | collapse %]',
218
        holdings: '[% PROCESS 'build_table' tab="holdings" | collapse %]',
219
        otherholdings: '[% PROCESS 'build_table' tab="otherholdings" | collapse %]',
219
        otherholdings: '[% PROCESS 'build_table' tab="otherholdings" | collapse %]',
220
    };
220
    };
221
    function build_items_table (tab_id, add_filters, dt_options) {
221
    function build_items_table (tab_id, add_filters, dt_options, drawcallback) {
222
222
223
        if ( dt_options && dt_options.hasOwnProperty('destroy') ) {
223
        if ( dt_options && dt_options.hasOwnProperty('destroy') ) {
224
            let table_id = "#"+tab_id+"_table";
224
            let table_id = "#"+tab_id+"_table";
Lines 753-758 Link Here
753
                    container.find(".top.pager").remove();
753
                    container.find(".top.pager").remove();
754
                    container.find(".bottom.pager").remove();
754
                    container.find(".bottom.pager").remove();
755
                }
755
                }
756
757
                if ( drawcallback ) { drawcallback(this); }
756
            },
758
            },
757
            [% END %]
759
            [% END %]
758
            ...dt_options,
760
            ...dt_options,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-5 / +10 lines)
Lines 1122-1130 Link Here
1122
        var interface = "[% interface | html %]";
1122
        var interface = "[% interface | html %]";
1123
        var theme = "[% theme | html %]";
1123
        var theme = "[% theme | html %]";
1124
        // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
1124
        // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
1125
        function verify_cover_images() {
1125
        function verify_cover_images(container) {
1126
            // Loop over each container in the template which contains covers
1126
            // Loop over each container in the template which contains covers
1127
            $(".cover-slider").each(function(){
1127
            let cover_sliders = container ? container.find('.cover-slider') : $(".cover-slider");
1128
            cover_sliders.each(function(){
1128
                var lightbox_descriptions = [];
1129
                var lightbox_descriptions = [];
1129
                var first_shown = 0;
1130
                var first_shown = 0;
1130
                $(this).find(".cover-image").each( function( index ){
1131
                $(this).find(".cover-image").each( function( index ){
Lines 1189-1195 Link Here
1189
1190
1190
            });
1191
            });
1191
1192
1192
            $(".cover-slider").each(function(){
1193
            cover_sliders.each(function(){
1193
                var coverSlide = this;
1194
                var coverSlide = this;
1194
                var coverImages = $(this).find(".cover-image");
1195
                var coverImages = $(this).find(".cover-image");
1195
                if( coverImages.length > 1 ){
1196
                if( coverImages.length > 1 ){
Lines 1231-1236 Link Here
1231
            });
1232
            });
1232
        }
1233
        }
1233
1234
1235
        let build_items_table_drawncallback = function (table) {
1236
            let tab_id = table.parents('.tab-pane').attr('id');
1237
            verify_cover_images($("#" + tab_id + '_table'));
1238
        };
1239
1234
        function removeLocalImage(imagenumber) {
1240
        function removeLocalImage(imagenumber) {
1235
            var thumbnail = $("#imagenumber-" + imagenumber );
1241
            var thumbnail = $("#imagenumber-" + imagenumber );
1236
            var copy = thumbnail.html();
1242
            var copy = thumbnail.html();
Lines 1710-1716 Link Here
1710
1716
1711
            let items_tab_ids = [ 'holdings', 'otherholdings' ];
1717
            let items_tab_ids = [ 'holdings', 'otherholdings' ];
1712
            items_tab_ids.forEach( function( tab_id, index ) {
1718
            items_tab_ids.forEach( function( tab_id, index ) {
1713
                build_items_table(tab_id, false);
1719
                build_items_table(tab_id, false, {}, build_items_table_drawncallback);
1714
1720
1715
                [% IF bundlesEnabled %]
1721
                [% IF bundlesEnabled %]
1716
                // Add event listener for opening and closing bundle details
1722
                // Add event listener for opening and closing bundle details
1717
- 

Return to bug 33568