Bug 34724: (QA follow-up):

Replace href from thumbnail link with a # to keep pointer event. The href link gets reconstructed by showCover anyway
Remove return false from on click event, its not triggering a location change anymore because of the above
Remove check for imagenumber, its a non-null primary key, if the image exists, then the imagenumber must also exist

Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit bc8a062001)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Pedro Amorim 2023-09-08 16:01:03 +00:00 committed by Fridolin Somers
parent bebd213c87
commit 167f5aa3bb

View file

@ -87,7 +87,7 @@
<div class="col-lg-3"> <div class="col-lg-3">
<div id="thumbnails"> <div id="thumbnails">
[% FOREACH image IN images %] [% FOREACH image IN images %]
<a class="cover_thumbnail" data-imagenumber="[% image.imagenumber| html %]" href="/cgi-bin/koha/opac-imageviewer.pl?biblionumber=[% biblionumber | url %]&amp;imagenumber=[% image.imagenumber| uri %]"> <a class="cover_thumbnail" data-imagenumber="[% image.imagenumber| html %]" href="#">
[% IF loop.first %] [% IF loop.first %]
<img class="thumbnail selected" id="[% image.imagenumber| html %]" src="/cgi-bin/koha/opac-image.pl?imagenumber=[% image.imagenumber | html %]&amp;thumbnail=1" alt="Thumbnail"/> <img class="thumbnail selected" id="[% image.imagenumber| html %]" src="/cgi-bin/koha/opac-image.pl?imagenumber=[% image.imagenumber | html %]&amp;thumbnail=1" alt="Thumbnail"/>
[% ELSE %] [% ELSE %]
@ -114,11 +114,7 @@
$("#largeCoverImg").attr("src","[% interface | html %]/[% theme | html %]/images/loading.gif"); $("#largeCoverImg").attr("src","[% interface | html %]/[% theme | html %]/images/loading.gif");
showCover([% imagenumber | html %]); showCover([% imagenumber | html %]);
$("a.cover_thumbnail").on('click',function(){ $("a.cover_thumbnail").on('click',function(){
let imagenumber = this.dataset.imagenumber; showCover(this.dataset.imagenumber);
if (imagenumber){
showCover(imagenumber);
}
return false;
}); });
}); });