Bugzilla – Attachment 164352 Details for
Bug 33568
Use the REST API to display items on the staff biblio detail view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33568: Fix local cover images
Bug-33568-Fix-local-cover-images.patch (text/plain), 5.09 KB, created by
Jonathan Druart
on 2024-04-03 07:40:40 UTC
(
hide
)
Description:
Bug 33568: Fix local cover images
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-04-03 07:40:40 UTC
Size:
5.09 KB
patch
obsolete
>From 7b4b89aeb200f4571273fd360f2bc52fc5014b60 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 20 Jul 2023 08:52:33 +0200 >Subject: [PATCH] Bug 33568: Fix local cover images >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >We need to reprocess the images when the table is refreshed, to do that >we teach verify_cover_images to go through a given container instead of >the whole document, and pass a call back function to build_items_table >that will be called when DataTables will have redrawn the table >(drawCallback). > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> > >Signed-off-by: Laurence Rault <laurence.rault@biblibre.com> >Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> >--- > .../html_helpers/tables/items/catalogue_detail.inc | 8 +++++--- > .../prog/en/modules/catalogue/detail.tt | 14 ++++++++++---- > 2 files changed, 15 insertions(+), 7 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >index 94f8e91dc81..5e9daedd7b6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >+++ b/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, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index ff690d3cb16..8055d18ca7a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/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 >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33568
:
151339
|
153791
|
164308
|
164309
|
164310
|
164311
|
164312
|
164313
|
164314
|
164315
|
164316
|
164317
|
164318
|
164319
|
164320
|
164321
|
164322
|
164323
|
164324
|
164325
|
164326
|
164327
|
164328
|
164329
|
164330
|
164331
|
164332
|
164333
|
164334
|
164335
|
164336
|
164337
|
164338
|
164339
|
164340
|
164341
|
164342
|
164343
|
164344
|
164345
|
164346
|
164347
|
164348
|
164349
|
164350
|
164351
|
164352
|
164353
|
164354
|
164355
|
164356
|
164358
|
164359
|
164360
|
164361
|
164362
|
164363
|
164364
|
164365
|
164366
|
164367
|
164368
|
164369
|
164370
|
164371
|
164372
|
164373
|
164374
|
164472
|
164480
|
164482
|
164483
|
164485
|
164528