discourse/app
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
..
assets FIX: lightbox setup blocked due to waiting for first image load (#22612) 2023-07-14 14:02:06 +08:00
controllers FIX: Dismissing unread posts did not publish changes to other clients (#22584) 2023-07-13 18:05:56 +08:00
helpers SECURITY: Don't reuse CSP nonce between requests (#22544) 2023-07-11 15:24:36 -06:00
jobs DEV: make sure we don't load all data into memory when exporting chat messages (#22276) 2023-07-12 18:52:18 +04:00
mailers FIX: Order tags shown in email subject by topics count and name (#22586) 2023-07-13 15:39:58 +08:00
models FEATURE: Extend the topics:read API scope to allow read by external_id (#22536) 2023-07-13 09:02:32 -06:00
serializers FEATURE: Inline topic summary. Cached version accessible to everyone. (#22551) 2023-07-12 11:21:51 -03:00
services FIX: more performance improvement for PostAlert job (#22487) 2023-07-13 09:02:23 +10:00
views SECURITY: Don't reuse CSP nonce between requests (#22544) 2023-07-11 15:24:36 -06:00