Bugzilla – Attachment 107272 Details for
Bug 25031
Improve handling of multiple covers on the biblio detail page in the staff client
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25031: (QA follow-up) Avoid displaying extra navigation
Bug-25031-QA-follow-up-Avoid-displaying-extra-navi.patch (text/plain), 4.34 KB, created by
Owen Leonard
on 2020-07-23 19:51:35 UTC
(
hide
)
Description:
Bug 25031: (QA follow-up) Avoid displaying extra navigation
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-07-23 19:51:35 UTC
Size:
4.34 KB
patch
obsolete
>From 7c19f572c806979bb381a449c72e748a82c9e1fc Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 23 Jul 2020 19:49:33 +0000 >Subject: [PATCH] Bug 25031: (QA follow-up) Avoid displaying extra navigation > >This patch reworks the construction of the navigation links in such a >way that they are built during a loop over an updated jQuery object. >Previously the stored variable might not reflect that some elements >had been removed. >--- > .../prog/en/modules/catalogue/detail.tt | 35 ++++++++++++---------- > 1 file changed, 19 insertions(+), 16 deletions(-) > >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 c09ccdbfb2..d2376ab098 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -164,6 +164,7 @@ > <div class="hint">Image from Adlibris</div> > </div> > [% END %] >+ > [% IF ( AmazonCoverImages && normalized_isbn) %] > <div class="cover-image" id="amazon-bookcoverimg"> > <a href="http://www.amazon[% AmazonTld | uri %]/gp/reader/[% normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link"> >@@ -172,6 +173,7 @@ > <div class="hint">Image from Amazon.com</div> > </div> > [% END %] >+ > [% IF ( IntranetCoce && CoceProviders && normalized_isbn ) %] > [% coce_id = normalized_ean || normalized_isbn %] > <div class="cover-image" id="coce-coverimg"> >@@ -936,8 +938,7 @@ Note that permanent location is a code, and location may be an authval. > // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html > function verify_images() { > // Loop over each container in the template which contains covers >- var coverSlides = $(".cover-image"); >- coverSlides.each( function( index ){ >+ $(".cover-image").each( function( index ){ > var div = $(this); > // Find the image in the container > var img = div.find("img")[0]; >@@ -977,24 +978,26 @@ Note that permanent location is a code, and location may be an authval. > div.find(".hint").html(_("Coce image from Open Library")); > } > } >- // If more that one slide is present, add a navigation link >- // for activating the slide >- if( coverSlides.length > 1 ){ >- var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>"); >- if( index == 0 ){ >- // Set the first navigation link as active >- $(covernav).addClass("nav-active"); >- } >- $(covernav).html("<i class=\"fa fa-circle\"></i>"); >- $("#cover-slides").addClass("cover-slides").append( covernav ); >- } > } > } > }); >- if( $(".cover-image").length < 2 ){ >- /* Don't show controls for switching between covers if there is only 1 */ >- $(".cover-nav").remove(); >+ >+ var coverSlides = $(".cover-image"); >+ if( coverSlides.length > 1 ){ >+ coverSlides.each(function( index ){ >+ // If more that one slide is present, add a navigation link >+ // for activating the slide >+ var covernav = $("<a href=\"#\" data-num=\"" + index + "\" class=\"cover-nav\"></a>"); >+ if( index == 0 ){ >+ // Set the first navigation link as active >+ $(covernav).addClass("nav-active"); >+ } >+ $(covernav).html("<i class=\"fa fa-circle\"></i>"); >+ $("#cover-slides").addClass("cover-slides").append( covernav ); >+ >+ }); > } >+ > if( $(".cover-image:visible").length < 1 ){ > $("#cover-slides").remove(); > } >-- >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 25031
:
102162
|
102295
|
103040
|
103079
|
105986
|
105987
|
106612
|
106613
| 107272 |
107310