Bugzilla – Attachment 105987 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) Improve handling of one or fewer images
Bug-25031-QA-follow-up-Improve-handling-of-one-or-.patch (text/plain), 4.05 KB, created by
Owen Leonard
on 2020-06-17 21:46:41 UTC
(
hide
)
Description:
Bug 25031: (QA follow-up) Improve handling of one or fewer images
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-06-17 21:46:41 UTC
Size:
4.05 KB
patch
obsolete
>From 185fc97b018fe8e5730f291aa5a7a4b7e60ec284 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 17 Jun 2020 21:45:00 +0000 >Subject: [PATCH] Bug 25031: (QA follow-up) Improve handling of one or fewer > images > >This patch addresses a few issues raised during QA: > >1. If there are no images, avoid the momentary appearance of an empty > borered box. The class controlling the appearance of the box is now > added after initialization. >2. If there is only one image, remove the control for switching > between covers. >3. Add "preventDefault" to cover naviation click handler. >4. Correct translation function in localcovers.js. > >This patch modifies SCSS, so rebuilding the staff client CSS is >necessary for testing. >--- > koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 9 +++++++-- > koha-tmpl/intranet-tmpl/prog/js/localcovers.js | 4 ++-- > 3 files changed, 10 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >index 3500e18d74..9657086546 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >+++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >@@ -2095,7 +2095,7 @@ li { > } > } > >-#cover-slides { >+.cover-slides { > background: #FFF url("[% interface | html %]/[% theme | html %]/img/spinner-small.gif") center center no-repeat; > border: 1px solid #b9d8d9; > border-radius: 3px; >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 ca54ed4618..191603e438 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -986,11 +986,15 @@ Note that permanent location is a code, and location may be an authval. > $(covernav).addClass("nav-active"); > } > $(covernav).html("<i class=\"fa fa-circle\"></i>"); >- $("#cover-slides").append( covernav ); >+ $("#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(); >+ } > if( $(".cover-image:visible").length < 1 ){ > $("#cover-slides").remove(); > } >@@ -1166,7 +1170,8 @@ Note that permanent location is a code, and location may be an authval. > link = $(this).attr("href"); > openWindow(link,"Print spine label",400,400); > }); >- $("#cover-slides").on("click",".cover-nav", function(){ >+ $("#cover-slides").on("click",".cover-nav", function(e){ >+ e.preventDefault(); > // Adding click handler for cover image navigation links > var num = $(this).data("num"); > $(".cover-nav").removeClass("nav-active"); >diff --git a/koha-tmpl/intranet-tmpl/prog/js/localcovers.js b/koha-tmpl/intranet-tmpl/prog/js/localcovers.js >index a25d7c73f4..fe94760aa4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/localcovers.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/localcovers.js >@@ -1,4 +1,4 @@ >-/* global _ */ >+/* global __ */ > > if (typeof KOHA == "undefined" || !KOHA) { > var KOHA = {}; >@@ -43,7 +43,7 @@ KOHA.LocalCover = { > var mydiv = this; > var message = document.createElement("span"); > $(message).attr("class","no-image thumbnail"); >- $(message).html( _("No cover image available") ); >+ $(message).html( __("No cover image available") ); > $(mydiv).append(message); > var img = $("<img />"); > img.attr('src','/cgi-bin/koha/catalogue/image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class")) >-- >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