|
Lines 38-79
KOHA.LocalCover = {
Link Here
|
| 38 |
mydiv.append(img); |
38 |
mydiv.append(img); |
| 39 |
} |
39 |
} |
| 40 |
}, |
40 |
}, |
| 41 |
LoadResultsCovers: function(){ |
|
|
| 42 |
$("div [id^=local-thumbnail]").each(function(i) { |
| 43 |
var mydiv = this; |
| 44 |
var message = document.createElement("span"); |
| 45 |
$(message).attr("class","no-image thumbnail"); |
| 46 |
$(message).html( __("No cover image available") ); |
| 47 |
$(mydiv).append(message); |
| 48 |
var img = $("<img />"); |
| 49 |
img.attr('src','/cgi-bin/koha/catalogue/image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class")) |
| 50 |
.addClass("thumbnail") |
| 51 |
.load(function () { |
| 52 |
if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth <= 1) { |
| 53 |
//IE HACK |
| 54 |
try { |
| 55 |
var otherCovers = $(mydiv).closest('td').find('img'); |
| 56 |
var nbCovers = otherCovers.length; |
| 57 |
if(nbCovers > 0){ |
| 58 |
var badCovers = 0; |
| 59 |
otherCovers.each(function(){ |
| 60 |
if(this.naturalWidth <= 1){ |
| 61 |
$(this).parent().remove(); |
| 62 |
badCovers++; |
| 63 |
} |
| 64 |
}); |
| 65 |
if(badCovers < nbCovers){ |
| 66 |
$(mydiv).parent().remove(); |
| 67 |
} |
| 68 |
} |
| 69 |
} |
| 70 |
catch(err){ |
| 71 |
} |
| 72 |
} else { |
| 73 |
$(mydiv).append(img); |
| 74 |
$(mydiv).children('.no-image').remove(); |
| 75 |
} |
| 76 |
}); |
| 77 |
}); |
| 78 |
} |
| 79 |
}; |
41 |
}; |