Bugzilla – Attachment 159784 Details for
Bug 35557
LoadResultsCovers is not used (staff)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35557: Remove LoadResultsCovers
Bug-35557-Remove-LoadResultsCovers.patch (text/plain), 3.42 KB, created by
Jonathan Druart
on 2023-12-13 10:07:03 UTC
(
hide
)
Description:
Bug 35557: Remove LoadResultsCovers
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-12-13 10:07:03 UTC
Size:
3.42 KB
patch
obsolete
>From 2a9c8095ee392fc8a461e59983ceb0c4f49f6201 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 13 Dec 2023 10:32:12 +0100 >Subject: [PATCH] Bug 35557: Remove LoadResultsCovers > >The JS function LoadResultsCovers is not used from the Staff interface. > >It is supposed to load the local cover images in JS but actually we are embedding the thumbnail in the img tag. > >Test plan: >Confirm that LoadResultsCovers was called but had no effect. >Note that the selector ^local-thumbnail only exists in shelfbrowser.inc > >but results.js is only used from results.tt (not shelfbrowser.inc) >--- > .../intranet-tmpl/prog/js/localcovers.js | 38 ------------------- > .../intranet-tmpl/prog/js/pages/results.js | 4 -- > 2 files changed, 42 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/localcovers.js b/koha-tmpl/intranet-tmpl/prog/js/localcovers.js >index fe94760aa4f..aa9c3b16267 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/localcovers.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/localcovers.js >@@ -38,42 +38,4 @@ KOHA.LocalCover = { > mydiv.append(img); > } > }, >- LoadResultsCovers: function(){ >- $("div [id^=local-thumbnail]").each(function(i) { >- var mydiv = this; >- var message = document.createElement("span"); >- $(message).attr("class","no-image thumbnail"); >- $(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")) >- .addClass("thumbnail") >- .load(function () { >- if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth <= 1) { >- //IE HACK >- try { >- var otherCovers = $(mydiv).closest('td').find('img'); >- var nbCovers = otherCovers.length; >- if(nbCovers > 0){ >- var badCovers = 0; >- otherCovers.each(function(){ >- if(this.naturalWidth <= 1){ >- $(this).parent().remove(); >- badCovers++; >- } >- }); >- if(badCovers < nbCovers){ >- $(mydiv).parent().remove(); >- } >- } >- } >- catch(err){ >- } >- } else { >- $(mydiv).append(img); >- $(mydiv).children('.no-image').remove(); >- } >- }); >- }); >- } > }; >diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/results.js b/koha-tmpl/intranet-tmpl/prog/js/pages/results.js >index 511dc7d1c19..72dc9304f01 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/pages/results.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/pages/results.js >@@ -231,10 +231,6 @@ $(document).ready(function() { > } > } > >- if( PREF_LocalCoverImages ){ >- KOHA.LocalCover.LoadResultsCovers(); >- } >- > if( PREF_IntranetCoce && PREF_CoceProviders ){ > KOHA.coce.getURL( CoceHost, CoceProviders ); > } >-- >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 35557
:
159783
|
159784
|
159913
|
160225
|
160226