Bug 32412: Do not reload COCE image for biblio
We do not want to fetch again the new image for the biblio record. We only want to fetch those for the shelf browser. Note that the third parameter 'covernewwindow' was not used. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
fec0bd18ae
commit
13dccaaf05
2 changed files with 7 additions and 5 deletions
|
@ -1880,7 +1880,7 @@
|
||||||
KOHA.Google.GetCoverFromIsbn([% covernewwindow | html %]);
|
KOHA.Google.GetCoverFromIsbn([% covernewwindow | html %]);
|
||||||
[% END %]
|
[% END %]
|
||||||
[% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %]
|
[% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %]
|
||||||
KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]',[% covernewwindow | html %]);
|
KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]', $("#bibliodescriptions"));
|
||||||
[% END %]
|
[% END %]
|
||||||
[% IF OpenLibraryCovers %]
|
[% IF OpenLibraryCovers %]
|
||||||
KOHA.OpenLibrary.GetCoverFromIsbn();
|
KOHA.OpenLibrary.GetCoverFromIsbn();
|
||||||
|
@ -1906,7 +1906,7 @@
|
||||||
KOHA.Google.GetCoverFromIsbn([% covernewwindow | html %]);
|
KOHA.Google.GetCoverFromIsbn([% covernewwindow | html %]);
|
||||||
[% END %]
|
[% END %]
|
||||||
[% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %]
|
[% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %]
|
||||||
KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]',[% covernewwindow | html %]);
|
KOHA.coce.getURL('[% Koha.Preference('CoceHost') | html %]', '[% Koha.Preference('CoceProviders') | html %]', $("#bibliodescriptions"));
|
||||||
[% END %]
|
[% END %]
|
||||||
[% IF OpenLibraryCovers %]
|
[% IF OpenLibraryCovers %]
|
||||||
KOHA.OpenLibrary.GetCoverFromIsbn();
|
KOHA.OpenLibrary.GetCoverFromIsbn();
|
||||||
|
|
|
@ -14,9 +14,11 @@ KOHA.coce = {
|
||||||
* and run a search with all collected isbns to coce cover service.
|
* and run a search with all collected isbns to coce cover service.
|
||||||
* The result is asynchronously returned, and used to append <img>.
|
* The result is asynchronously returned, and used to append <img>.
|
||||||
*/
|
*/
|
||||||
getURL: function(host, provider) {
|
getURL: function(host, provider, parent=null) {
|
||||||
var ids = [];
|
var ids = [];
|
||||||
$("[id^=coce-thumbnail]").each(function() {
|
const thumbnail_selector = "[id^=coce-thumbnail]";
|
||||||
|
let thumbnail_nodes = parent ? parent.find(thumbnail_selector) : $(thumbnail_selector);
|
||||||
|
thumbnail_nodes.each(function() {
|
||||||
var id = $(this).attr("class"); // id=isbn
|
var id = $(this).attr("class"); // id=isbn
|
||||||
if (id !== '') { ids.push(id); }
|
if (id !== '') { ids.push(id); }
|
||||||
});
|
});
|
||||||
|
@ -40,7 +42,7 @@ KOHA.coce = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$(this).attr('href', url);
|
$(this).attr('href', url);
|
||||||
$(this).empty().append(img);
|
$(this).append(img);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue