Bug 32642: Loading spinner always visible when cover image is short (OPAC)
authorHammat Wele <hammat.wele@inlibro.com>
Thu, 6 Apr 2023 23:38:22 +0000 (23:38 +0000)
committerJacob O'Mara <jacobomara901@gmail.com>
Wed, 10 May 2023 12:40:20 +0000 (13:40 +0100)
commitea6eee6b24d87558e7ead07ac290ac0763406afc
tree50347321fc482500ff4bcc3ceb360560093108d4
parent8b2676bf81132406fcf7cf52b383cf5cccc00df4
Bug 32642: Loading spinner always visible when cover image is short (OPAC)

We noticed that if the cover image is somewhat short (i.e. the height is under 80-90 px), the loading spinner indicating that the image is currently loading still appears after the image is loaded.

this patch remove the spinner when the image is loaded,.

To test:
1. Make sure the OPACLocalCoverImages system preference is enabled
   1.1. Go to Administration > Global system preferences
   1.2. Search for Coverimages
   1.3. Set OPACLocalCoverImages to 'Show'
   1.4. Click 'Save all Enhanced content preferences'
2. Add a short local cover image to a record (I added one which is just a grey rectangle with the size printed on it, to facilitate the test)
   2.1. Download the attached image
   2.2. Find a record without an image
   2.3. Click the 'Images' tab
   2.4. Click 'Upload'
   2.5. Click 'Drop files here or click to select a file' and choose the downloaded image
   2.6. Click 'Process images'
3. View the record in the OPAC
   3.1. From the image upload page, click on the title of the record in the page heading to access the detailed record in the staff interface
   3.2. Click on 'OPAC view: Open in new window.'
   --> Note that the image is displayed normally, but the spinner is also displayed
4. Apply the patch
5. View the record in the OPAC
    --> Note that the spinner is no more displayed

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
This needs a follow-up; the code in this template activates the spinner
actually when the job has been done already and did not remove it.
And we did not see that but only with a short image like above.
The construction with .one, .each is not needed given the execution
context.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 408e676fd29188ce40c6dbf94b47845df9ba1984)
Signed-off-by: Jacob O'Mara <jacobomara901@gmail.com>
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt