View | Details | Raw Unified | Return to bug 35557
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/js/localcovers.js (-38 lines)
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
};
(-)a/koha-tmpl/intranet-tmpl/prog/js/pages/results.js (-5 lines)
Lines 231-240 $(document).ready(function() { Link Here
231
        }
231
        }
232
    }
232
    }
233
233
234
    if( PREF_LocalCoverImages ){
235
        KOHA.LocalCover.LoadResultsCovers();
236
    }
237
238
    if( PREF_IntranetCoce && PREF_CoceProviders ){
234
    if( PREF_IntranetCoce && PREF_CoceProviders ){
239
        KOHA.coce.getURL( CoceHost, CoceProviders );
235
        KOHA.coce.getURL( CoceHost, CoceProviders );
240
    }
236
    }
241
- 

Return to bug 35557