Bugzilla – Attachment 160280 Details for
Bug 35647
Coce images won't load on the staff results page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35647: Use callback when waiting for Coce to load
Bug-35647-Use-callback-when-waiting-for-Coce-to-lo.patch (text/plain), 2.45 KB, created by
David Nind
on 2023-12-23 06:57:05 UTC
(
hide
)
Description:
Bug 35647: Use callback when waiting for Coce to load
Filename:
MIME Type:
Creator:
David Nind
Created:
2023-12-23 06:57:05 UTC
Size:
2.45 KB
patch
obsolete
>From 6d64a4ec754f4e1d328d9d4b9598c4b9e072b2b2 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 22 Dec 2023 21:47:49 +0000 >Subject: [PATCH] Bug 35647: Use callback when waiting for Coce to load > >1. Turn on all CoceProviders and IntranetCoce. >2. Set CoceHost to 'https://coce.bywatersolutions.com' >3. Do a search and notice that no Coce images load on the results page. >4. Apply patch, clear browser cache and try again. >5. Images should load. > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../intranet-tmpl/prog/js/pages/results.js | 27 ++++++++++++++++--- > 1 file changed, 23 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/results.js b/koha-tmpl/intranet-tmpl/prog/js/pages/results.js >index 511dc7d1c1..042e6aa7ff 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/pages/results.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/pages/results.js >@@ -46,8 +46,8 @@ function verify_cover_images() { > if ( (img.complete != null) && (!img.complete) || img.naturalHeight == 0 ) { > /* No image was loaded via the CustomCoverImages system preference */ > /* Remove the container */ >- blanks.push( coverId ); > div.remove(); >+ blanks.push( coverId ); > } > } > >@@ -75,10 +75,9 @@ function verify_cover_images() { > } > } /* /IF image loaded */ > } else { >- blanks.push( coverId ); > div.remove(); >+ blanks.push( coverId ); > } /* /IF there is an image tag */ >- /* console.log( coverImages ); */ > }); > > /* Show the first cover image slide after empty ones have been removed */ >@@ -100,8 +99,28 @@ function verify_cover_images() { > }); > } > >+let counter_wait = 0; >+function wait_for_images(cb){ >+ >+ var loaded = 1; >+ counter_wait++; >+ >+ if ( loaded ) { >+ loaded = KOHA.coce.done; >+ } >+ >+ if (!loaded && counter_wait < 50) {// Do not wait more than 5 seconds >+ window.setTimeout(function(){wait_for_images(cb);}, 100); >+ } else { >+ if (counter_wait >= 50 ) { >+ console.log("Could not retrieve the images") >+ } >+ cb(); >+ } >+} >+ > $(window).load(function() { >- verify_cover_images(); >+ wait_for_images(verify_cover_images); > }); > > var Sticky; >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35647
:
160279
| 160280 |
161616