@@ -, +, @@ section. --- koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js | 5 +- .../prog/en/modules/catalogue/detail.tt | 58 ++++++++++++-------- 2 files changed, 36 insertions(+), 27 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js +++ a/koha-tmpl/intranet-tmpl/prog/en/js/localcovers.js @@ -27,11 +27,10 @@ KOHA.LocalCover = { var img = $("").attr('src', '/cgi-bin/koha/catalogue/image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class")) .load(function () { - if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) { + if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth <= 1) { //IE HACK try { - $(mydiv).append(img); - $(mydiv).children('.no-image').remove(); + $(mydiv).remove(); } catch(err){ } --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -28,19 +28,22 @@ //= 0) || (this.src.indexOf('g-images.amazon.com') >=0) || (this.src.indexOf('images-na.ssl-images-amazon.com'))) { - w = this.width; - h = this.height; - if ((w == 1) || (h == 1)) { - $("#bookcoverimg").remove(); - $(".yui-gb").attr("class","yui-g"); - } else if ((this.complete != null) && (!this.complete)) { - $("#bookcoverimg").remove(); - $(".yui-gb").attr("class","yui-g"); + $("#bookcoverimg").each(function(i){ + $(this).find('img').each(function(i){ + if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0) || (this.src.indexOf('images-na.ssl-images-amazon.com'))) { + w = this.width; + h = this.height; + if ((w == 1) || (h == 1)) { + $("#amazon-bookcoverimg").remove(); + $(".yui-gb").attr("class","yui-g"); + } else if ((this.complete != null) && (!this.complete)) { + $("#amazon-bookcoverimg").remove(); + $(".yui-gb").attr("class","yui-g"); + } } - } }); + if( $(this).find('img').length < 1 ) $(this).remove(); + }); $("#editions img").each(function(i){ if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0) || (this.src.indexOf('images-na.ssl-images-amazon.com'))) { w = this.width; @@ -180,9 +183,9 @@ function verify_images() { [% END %] }); - [% IF ( AmazonCoverImages ) %]$(window).load(function() { + [% IF ( AmazonCoverImages || LocalCoverImages )%]$(window).load(function() { verify_images(); - });[% END %] + });[% END %] //]]> @@ -369,17 +372,21 @@ function verify_images() { MARC Preview: Show [% IF ( holdcount ) %]Holds: [% holdcount %][% ELSE %][% END %] - [% IF ( ( AmazonEnabled && AmazonCoverImages ) || LocalCoverImages ) %] + [% IF ( AmazonCoverImages || LocalCoverImages ) %]
- [% IF ( LocalCoverImages ) %]
[% END %] - [% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]
- + [% IF ( LocalCoverImages ) %] +
+ [% END %] + [% IF ( AmazonCoverImages ) %] +
[% END %][% END %] +
+ [% END %] [% END %] [% ELSE %] @@ -443,10 +450,13 @@ function verify_images() {
- [% IF ( ( AmazonEnabled && AmazonCoverImages ) || LocalCoverImages ) %] + [% IF ( AmazonCoverImages || LocalCoverImages ) %]
- [% IF ( LocalCoverImages ) %]
[% END %] - [% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]
+ [% IF ( LocalCoverImages ) %] +
+ [% END %] + [% IF ( AmazonCoverImages ) %] + - [% END %][% END %] + [% END %]
[% END %] --