From f979a148877ce4ce363ea7f023f79ca9c24468bc Mon Sep 17 00:00:00 2001 From: Hammat Wele Date: Thu, 19 Jan 2023 15:50:49 +0000 Subject: [PATCH] =?UTF-8?q?Bug=C2=A028314:=20Spinning=20icon=20is=20not=20?= =?UTF-8?q?always=20going=20away=20for=20local=20covers=20in=20staff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The spinner is always visible with images which are under 80-90 px high this patch remove the spinner when the image is loaded. To test: 1. Make sure the LocalCoverImages system preference is enabled 1.1. Go to Administration > Global system preferences 1.2. Search for Coverimages 1.3. Set LocalCoverImages 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' 2.7. Click on the title of the record in the page heading to access the detailed record --> Note that the image is displayed normally, but the spinner is also displayed 4. Apply the patch 5. Search for the previous record with the small image 6. Click on the title of the record in the page heading to access the detailed record --> Note that the spinner is no more displayed Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Martin Renvoize --- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 9d9e3a33790..5fb65167b40 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1406,6 +1406,10 @@ Note that permanent location is a code, and location may be an authval. $(coverSlide).remove(); } else { $(coverSlide).addClass("cover-slides"); + var img = $(coverSlide).find(".cover-image:visible").find("img")[0]; + if( $(img).length > 0 && img.complete && img.naturalHeight > 0 ){ + $(".cover-slides").css({"background-image":"none"}); + } } }); -- 2.39.1