diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js b/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js
index 58e13cf2f4..253d7a6082 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js
+++ b/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js
@@ -46,7 +46,44 @@ KOHA.LocalCover = {
}
$(mydiv).children('.no-image').remove();
}
- })
+ });
+ });
+ },
+ 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_LOCAL_JACKET);
+ $(mydiv).append(message);
+ var img = $("");
+ img.attr('src','/cgi-bin/koha/catalogue/image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class"));
+ img.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/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
index c3ea895480..48bc90b259 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
@@ -174,6 +174,9 @@ function verify_images() {
[%# inject no images message %]
[% IF ( LocalCoverImages && ! localimages.0 ) %]
showNoImageMessage();
+ [% END %]
+ [% IF LocalCoverImages %]
+ KOHA.LocalCover.GetCoverFromBibnumber(true);
[% END %]
$("body").on("click",".previewMARC", function(e){
e.preventDefault();
@@ -184,9 +187,6 @@ function verify_images() {
$("#marcPreview").on("hidden", function(){
$("#marcPreview .modal-body").html("
+ [% ELSIF ( !LocalCoverImages ) %]
+
+