Koha/koha-tmpl/opac-tmpl/bootstrap/js
Jonathan Druart fd6cbf2273
Bug 32307: Fix gallery when Coce is enabled
Bug 28179 added the gallery in the staff interface, and bug 28180 in the
OPAC.

OPAC and staff have different code, because the cover image providers
are different.
On bug 28180 we noticed that the OPAC needed additional code to handle
OpenLibrary, Google Jacket and Coce, to differ the creation of the
gallery to prevent Chocolat to be instantiated before the links (img src)
are effectively in the DOM.

To acchieve that we introduced a wait_for_images function, and added a
"done" flag to the 3 "JS modules".

However we haven't ported this code for the staff interface, which is
also using Coce.

Note that there was a bug at the OPAC as well for COCE, the ajax jQuery
function is async, and so 'done' was set even if the call was not
finished.

Test plan:
0. Do not apply this patch
1. Enable LocalCoverImages and IntranetCoce
2. Pick a bibliographic record with an image returned from Coce
3. Add a local cover image
4. Go to the detail page
5. Open the gallery
=> Notice that you can notice a JS error and a loading icon on the
second image. This behaviour is not always broken, it depends on the
speed of the Coce server. If you don't see the problem reload the page.
6. Apply the patch and repeat
=> Notice that the cover slider block is longer to display the icon, but
that the error is gone.
7. Confirm that there is no regression at the OPAC

We could improve the situation here, and we could display the images
in the slider, especially if the first image is a local image. But
that's for another bug...

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2023-02-20 09:54:16 -03:00
..
amazonimages.js
authtoresults.js Bug 17153: Redirect to search when logging in from search 2018-06-29 20:49:51 +00:00
autofill.js Bug 14242: (follow-up) Clear all text input fields 2022-05-03 11:19:50 -10:00
bakertaylorimages.js
basket.js Bug 28901: showCart incorrectly calculates position if content above navbar 2021-11-02 16:06:51 +01:00
browse.js Bug 27200: (follow-up) Browse search interface update 2020-12-26 17:58:43 +01:00
browserid_include.js
coce.js Bug 32307: Fix gallery when Coce is enabled 2023-02-20 09:54:16 -03:00
datatables.js Bug 32401: Remove x-koha-query support 2023-02-02 11:59:26 -03:00
Gettext.js Bug 21156: Add plural translation capabilities to JS files 2020-02-10 10:14:46 +00:00
global.js Bug 32125: Select correct tab on return 2023-02-09 10:21:32 -03:00
google-jackets.js Bug 28180: Correctly guess if images have been loaded 2021-10-21 12:24:04 +02:00
i18n.js Bug 21156: Add plural translation capabilities to JS files 2020-02-10 10:14:46 +00:00
ill-availability.js Bug 27170: Fix bug fix 2021-09-21 20:22:57 +02:00
localcovers.js Bug 28180: (follow-up) Updates to styling of lightbox controls 2021-10-21 12:24:04 +02:00
openlibrary.js Bug 28180: Correctly guess if images have been loaded 2021-10-21 12:24:04 +02:00
overdrive.js Bug 29845: add classes to overdrive results action buttons 2022-02-23 22:05:33 -10:00
ratings.js Bug 29939: Use the REST API for ratings 2022-08-22 11:31:15 -03:00
recordedbooks.js Bug 31040: jsTree image being used outside of jsTree plugin 2022-07-05 09:18:20 -03:00
tags.js
verovio.js Bug 22581: Show and play musical inscripts 2019-11-03 08:11:38 +00:00