Defer callback after images are loaded in image review UIs.

Review Request #13545 — Created Feb. 16, 2024 and submitted — Latest diff uploaded

Information

Review Board
master

Reviewers

The callback that handles the initial sizing/scaling for images was
sometimes running before jquery finished setting the initial-width and
initial-height data, which could result in one of the two images in
the two-up view being scaled and one not. This change adds a _.defer
call to unwind the stack before we trigger that callback.

Loaded a diff that had a bunch of changed images with @2x versions. Saw
that I was no longer able to trigger the case where one out of the two
images was full size and one was 50%.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Defer callback after images are loaded in image review UIs.
The callback that handles the initial sizing/scaling for images was sometimes running before jquery finished setting the `initial-width` and `initial-height` data, which could result in one of the two images in the two-up view being scaled and one not. This change adds a `_.defer` call to unwind the stack before we trigger that callback. Testing Done: Loaded a diff that had a bunch of changed images with @2x versions. Saw that I was no longer able to trigger the case where one out of the two images was full size and one was 50%.
d7c7800799447f1a7e842a7b036784556330b4a8 David Trowbridge
reviewboard/static/rb/js/reviews/views/imageReviewableView.ts
Loading...