discourse/app/assets
David Battersby ad365fad7a
FIX: lightbox setup blocked due to waiting for first image load (#22612)
The Problem
Clicking on a large image opens lightbox, however the new lightbox currently waits for the first image to finish loading before it finishes loading the lightbox UI correctly (ie. background color). This makes the visual experience feel broken.

Because open() is waiting for the image to load, it doesn't trigger the onOpen callback, which appends a .has-lightbox class to the html tag. The lightbox background color requires that css class to be set for the styles to be applied correctly.

The Solution
This PR prevents blocking when loading loading the first image (image that was clicked) within the lightbox, and therefore allows the css class to be appended to the html tag correctly and as a result fixing the styling issues.

The #setCurrentItem  function is async and awaits the loading of preloadItemImages already, so the image will load correctly when complete despite the rest of the UI loading in advance.
2023-07-14 14:02:06 +08:00
..
images FIX: fallback to default push notification icon if none exists (#16961) 2022-06-01 12:00:05 +10:00
javascripts FIX: lightbox setup blocked due to waiting for first image load (#22612) 2023-07-14 14:02:06 +08:00
stylesheets FEATURE: New Discourse Lightbox using Glimmer (#19798) 2023-07-13 15:06:17 +08:00