1
0
Fork 0
forked from OpenNeo/impress
impress/app/assets/javascripts
Emi Matchu d69c37089e Fix bug where item preview loading indicator sometimes doesn't delay
The loading indicator *should* fade in after two seconds, to avoid a
flash of a loading indicator when the page loads quickly - but in some
circumstances it wouldn't delay:

1. Visit an item page. (It delays correctly the first time!)
2. Click "Infinite Closet", then click a link to another item page.
3. The loading indicator appears immediately, because this time the
   web component JS is already loaded, so the `outfit-layer` elements
   enter `:state(loading)` *immediately*. The element starts at
   `opacity: 1`, and the delay doesn't matter, because it was never at
   anything else.

In this change, we have the `outfit-viewer` web component take on a
`:state(after-first-frame)`, after a `setTimeout(0)` resolves. That
enables the loading state CSS to *never* apply on the first frame, but
then sometimes kick in on the *second* frame, so that the element is
correctly perceived as "transitioning" from hidden to visible, and the
two-second delay will apply.
2024-09-06 12:13:10 -07:00
..
closet_hangers Fix various JS Turbo issues 2024-03-13 21:26:22 -07:00
closet_lists Add trade warning to closet list form 2024-04-16 16:53:30 -07:00
fundraising/donations Fix various JS Turbo issues 2024-03-13 21:26:22 -07:00
items Auto-submit the species color picker on change, for new item previews 2024-09-05 17:34:54 -07:00
lib Use "morphing" for smoother item page preview changes 2024-07-03 21:52:43 -07:00
outfits Fix various JS Turbo issues 2024-03-13 21:26:22 -07:00
pets Add better support for hashed pet names 2024-08-31 12:07:52 -07:00
swf_assets Potentially improve loading state in new item page preview 2024-07-08 16:44:22 -07:00
ajax_auth.js Run Prettier on some of our JS assets 2024-02-18 20:34:55 -08:00
outfit-viewer.js Fix bug where item preview loading indicator sometimes doesn't delay 2024-09-06 12:13:10 -07:00