@@ -, +, @@ --- .../html_helpers/tables/items/catalogue_detail.inc | 8 +++++--- .../prog/en/modules/catalogue/detail.tt | 14 ++++++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc @@ -145,7 +145,7 @@ tab.find(".show_filters").hide(); tab.find(".hide_filters").show(); $("#"+tab_id+"_table thead tr:eq(1)").remove(); - build_items_table(tab_id, true, { destroy: true } ); + build_items_table(tab_id, true, { destroy: true }, build_items_table_drawncallback ); }); $(".hide_filters").on("click",function(e){ @@ -155,7 +155,7 @@ tab.find(".hide_filters").hide(); tab.find(".show_filters").show(); $("#"+tab_id+"_table thead tr:eq(1)").remove(); - build_items_table(tab_id, false, { destroy: true } ); + build_items_table(tab_id, false, { destroy: true }, build_items_table_drawncallback ); }); }); [% END %] @@ -218,7 +218,7 @@ holdings: '[% PROCESS 'build_table' tab="holdings" | collapse %]', otherholdings: '[% PROCESS 'build_table' tab="otherholdings" | collapse %]', }; - function build_items_table (tab_id, add_filters, dt_options) { + function build_items_table (tab_id, add_filters, dt_options, drawcallback) { if ( dt_options && dt_options.hasOwnProperty('destroy') ) { let table_id = "#"+tab_id+"_table"; @@ -753,6 +753,8 @@ container.find(".top.pager").remove(); container.find(".bottom.pager").remove(); } + + if ( drawcallback ) { drawcallback(this); } }, [% END %] ...dt_options, --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1122,9 +1122,10 @@ var interface = "[% interface | html %]"; var theme = "[% theme | html %]"; // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html - function verify_cover_images() { + function verify_cover_images(container) { // Loop over each container in the template which contains covers - $(".cover-slider").each(function(){ + let cover_sliders = container ? container.find('.cover-slider') : $(".cover-slider"); + cover_sliders.each(function(){ var lightbox_descriptions = []; var first_shown = 0; $(this).find(".cover-image").each( function( index ){ @@ -1189,7 +1190,7 @@ }); - $(".cover-slider").each(function(){ + cover_sliders.each(function(){ var coverSlide = this; var coverImages = $(this).find(".cover-image"); if( coverImages.length > 1 ){ @@ -1231,6 +1232,11 @@ }); } + let build_items_table_drawncallback = function (table) { + let tab_id = table.parents('.tab-pane').attr('id'); + verify_cover_images($("#" + tab_id + '_table')); + }; + function removeLocalImage(imagenumber) { var thumbnail = $("#imagenumber-" + imagenumber ); var copy = thumbnail.html(); @@ -1710,7 +1716,7 @@ let items_tab_ids = [ 'holdings', 'otherholdings' ]; items_tab_ids.forEach( function( tab_id, index ) { - build_items_table(tab_id, false); + build_items_table(tab_id, false, {}, build_items_table_drawncallback); [% IF bundlesEnabled %] // Add event listener for opening and closing bundle details --