BUG 11602: [ENH] Fix localcover display
authorNicholas van Oudtshoorn <vanoudt@gmail.com>
Thu, 15 May 2014 05:27:48 +0000 (13:27 +0800)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 4 Dec 2015 16:12:52 +0000 (16:12 +0000)
Adds a css class of thumbnail to local covers.
Don't show the 1px "No image found" image
(since we'll ususally try another image provider)

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Box with "No cover image availabe" fixed when syspref OPACLocalCoverImages
set to display

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
koha-tmpl/opac-tmpl/bootstrap/js/localcovers.js

index e9d2f9e..daae010 100644 (file)
@@ -28,6 +28,7 @@ KOHA.LocalCover = {
             var img = $("<img />").attr('src',
                 '/cgi-bin/koha/opac-image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class"))
                 .load(function () {
+                    this.setAttribute("class", "thumbnail");
                     if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) {
                         //IE HACK
                         try {
@@ -36,7 +37,7 @@ KOHA.LocalCover = {
                         }
                         catch(err){
                         };
-                    } else {
+                    } else if (this.width > 1) { // don't show the silly 1px "no image" img
                         if (uselink) {
                             var a = $("<a />").attr('href', '/cgi-bin/koha/opac-imageviewer.pl?biblionumber=' + $(mydiv).attr("class"));
                             $(a).append(img);