Bugzilla – Attachment 126609 Details for
Bug 28180
Use a lightbox gallery to display the images on the detail pages in OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28180: Fix bug with first image does not exist
Bug-28180-Fix-bug-with-first-image-does-not-exist.patch (text/plain), 2.25 KB, created by
Katrin Fischer
on 2021-10-20 20:42:58 UTC
(
hide
)
Description:
Bug 28180: Fix bug with first image does not exist
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2021-10-20 20:42:58 UTC
Size:
2.25 KB
patch
obsolete
>From 430014a6f6395b2cc0dee44a82ad14c0db17af73 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 13 Sep 2021 00:08:35 +0200 >Subject: [PATCH] Bug 28180: Fix bug with first image does not exist > >This was first written for Adlibris, before its removal from the >codebase. >But this patch maybe still be useful for other services (if first and no image). > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index 9b6ec9a27f..00bd80863a 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -1392,19 +1392,21 @@ > // Loop over each container in the template which contains covers > $(".cover-slider").each(function( index ){ > var lightbox_descriptions = []; >+ var first_shown = 0; > $(this).find(".cover-image").each( function( index ){ > var div = $(this); > // Find the image in the container > var img = div.find("img")[0]; > if( img && $(img).length > 0 ){ > var description = ""; >- if( (( img.complete != null && !img.complete) || img.naturalHeight == 0 ) && div.attr("id") != "googlejacket-coverimg" ){ >+ if( img.naturalHeight == 0 && div.attr("id") != "googlejacket-coverimg" ){ > // No image loaded in the container. Remove the slide > div.remove(); > } else { > // All slides start hidden. If this is the first one, show it. >- if( index == 0 ){ >+ if( first_shown == 0 ){ > div.show(); >+ first_shown = 1; > } > // Check if Amazon image is present > if ( div.attr("id") == "amazon-bookcoverimg" ) { >-- >2.11.0
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 28180
:
119918
|
119919
|
119920
|
119921
|
119922
|
119923
|
119924
|
120444
|
120445
|
120446
|
120447
|
120448
|
120449
|
120450
|
120464
|
120465
|
120466
|
120467
|
120468
|
120469
|
120470
|
120753
|
120754
|
120805
|
122783
|
122784
|
123178
|
123790
|
123792
|
123793
|
123794
|
124819
|
125666
|
126041
|
126042
|
126506
|
126507
|
126508
|
126509
|
126510
|
126511
|
126512
|
126513
|
126514
|
126515
|
126516
|
126517
|
126518
|
126519
|
126520
|
126596
|
126597
|
126598
|
126599
|
126600
|
126601
|
126602
|
126603
|
126604
|
126605
|
126606
|
126607
|
126608
| 126609 |
126610