]> git.openstreetmap.org Git - rails.git/commit
Specify avatar dimensions in html tags
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 29 Sep 2021 17:47:20 +0000 (18:47 +0100)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 13 Oct 2021 13:05:02 +0000 (14:05 +0100)
commit9f61d6c1cf2d796ba8089f299679c2496ecfbbca
tree97dc40eb3424c3f2952525dd3f5140121bfbc06f
parent36179746309d7659d3e20512c34bc2742b094a04
Specify avatar dimensions in html tags

This prevents reflow when the images are loaded by the browser.

ActiveStorage variants are resized lazily when the image is requested,
so we only know the dimensions if the image was already loaded. This
means that there will be one reflow just after a new avatar is first
viewed.
app/helpers/user_helper.rb
test/helpers/user_helper_test.rb