Browse Source

Bug 10856: Fix cover display in shelf browser

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
I was able to reproduce the problem with local covers and
the patch fixes it in my tests.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
new/bootstrap-opac
Julian Maurice 9 years ago
committed by Galen Charlton
parent
commit
117f8a5ccc
  1. 18
      koha-tmpl/opac-tmpl/prog/en/includes/shelfbrowser.inc
  2. 4
      koha-tmpl/opac-tmpl/prog/en/js/google-jackets.js
  3. 4
      koha-tmpl/opac-tmpl/prog/en/js/localcovers.js
  4. 2
      koha-tmpl/opac-tmpl/prog/en/js/openlibrary.js

18
koha-tmpl/opac-tmpl/prog/en/includes/shelfbrowser.inc

@ -100,6 +100,15 @@
},
success: function(data){
$("#shelfbrowser").replaceWith(data);
[% IF ( GoogleJackets ) %]
KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
[% END %]
[% IF OpenLibraryCovers %]
KOHA.OpenLibrary.GetCoverFromIsbn();
[% END %]
[% IF OPACLocalCoverImages %]
KOHA.LocalCover.GetCoverFromBibnumber(true);
[% END %]
}
});
});
@ -115,6 +124,15 @@
},
success: function(data){
$("#shelfbrowser").replaceWith(data);
[% IF ( GoogleJackets ) %]
KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
[% END %]
[% IF OpenLibraryCovers %]
KOHA.OpenLibrary.GetCoverFromIsbn();
[% END %]
[% IF OPACLocalCoverImages %]
KOHA.LocalCover.GetCoverFromBibnumber(true);
[% END %]
}
});
});

4
koha-tmpl/opac-tmpl/prog/en/js/google-jackets.js

@ -51,7 +51,7 @@ KOHA.Google = {
if (typeof(book.thumbnail_url) != "undefined") {
var img = document.createElement("img");
img.src = book.thumbnail_url;
$(this).append(img);
$(this).empty().append(img);
var re = /^gbs-thumbnail-preview/;
if ( re.exec($(this).attr("id")) ) {
$(this).append(
@ -67,7 +67,7 @@ KOHA.Google = {
var message = document.createElement("span");
$(message).attr("class","no-image");
$(message).html(NO_GOOGLE_JACKET);
$(this).append(message);
$(this).empty().append(message);
}
});
}

4
koha-tmpl/opac-tmpl/prog/en/js/localcovers.js

@ -39,9 +39,9 @@ KOHA.LocalCover = {
if (uselink) {
var a = $("<a />").attr('href', '/cgi-bin/koha/opac-imageviewer.pl?biblionumber=' + $(mydiv).attr("class"));
$(a).append(img);
$(mydiv).append(a);
$(mydiv).empty().append(a);
} else {
$(mydiv).append(img);
$(mydiv).empty().append(img);
}
$(mydiv).children('.no-image').remove();
}

2
koha-tmpl/opac-tmpl/prog/en/js/openlibrary.js

@ -48,7 +48,7 @@ KOHA.OpenLibrary = {
var img = document.createElement("img");
if (is_opacdetail) {
img.src = book.cover.medium;
$(this).append(img);
$(this).empty().append(img);
$(this).append('<div class="results_summary">' + '<a href="' + book.url + '">Preview</a></div>');
} else {
img.src = book.cover.medium;

Loading…
Cancel
Save