From b16cc61e8bc7a5ade7183c3ca4c4d8d7a128ac4b Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 14 Oct 2013 23:23:44 +0000 Subject: [PATCH] Bug 10309: (follow-up) apply another follow-up for 10856, improve shelf browser This patch adapts a patch by Julian Maurice to prevent the main cover image from getting duplicated if the shelf browser is used. Signed-off-by: Galen Charlton --- koha-tmpl/opac-tmpl/bootstrap/js/google-jackets.js | 4 ++-- koha-tmpl/opac-tmpl/bootstrap/js/localcovers.js | 4 ++-- koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/google-jackets.js b/koha-tmpl/opac-tmpl/bootstrap/js/google-jackets.js index f129c3805e..b23599f24f 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/google-jackets.js +++ b/koha-tmpl/opac-tmpl/bootstrap/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); } }); } diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/localcovers.js b/koha-tmpl/opac-tmpl/bootstrap/js/localcovers.js index 6d247983bf..7bd7ae254a 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/localcovers.js +++ b/koha-tmpl/opac-tmpl/bootstrap/js/localcovers.js @@ -39,9 +39,9 @@ KOHA.LocalCover = { if (uselink) { var 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(); } diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js b/koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js index 10a58dd38a..9142273b96 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/js/openlibrary.js +++ b/koha-tmpl/opac-tmpl/bootstrap/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(''); } else { img.src = book.cover.medium; -- 2.39.5