diff options
author | Sean McGivern <sean@mcgivern.me.uk> | 2017-07-27 15:34:17 +0000 |
---|---|---|
committer | Sean McGivern <sean@mcgivern.me.uk> | 2017-07-27 15:34:17 +0000 |
commit | d5f91df9a5e5adf58f1729cda728babcd10f7099 (patch) | |
tree | ab557513fad6e9733999a4e8d081dd1f1cb4f3f8 /doc | |
parent | ac0cbe69706a2d3013d37adda7514824a2d06ed4 (diff) | |
parent | 710d0435f7c54801ff9efafc14a46095f3c83244 (diff) | |
download | gitlab-ce-d5f91df9a5e5adf58f1729cda728babcd10f7099.tar.gz |
Merge branch '35577-fix-image-blob-display-due-to-lazy-image-loading' into 'master'
Resolve "Fix Image Blob Display due to lazy Image Loading"
Closes #35577
See merge request !13104
Diffstat (limited to 'doc')
-rw-r--r-- | doc/development/fe_guide/performance.md | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/development/fe_guide/performance.md b/doc/development/fe_guide/performance.md index f25313d6cff..14ac1133cc0 100644 --- a/doc/development/fe_guide/performance.md +++ b/doc/development/fe_guide/performance.md @@ -29,11 +29,12 @@ To improve the time to first render we are using lazy loading for images. This w the actual image source on the `data-src` attribute. After the HTML is rendered and JavaScript is loaded, the value of `data-src` will be moved to `src` automatically if the image is in the current viewport. -* Prepare images in HTML for lazy loading by renaming the `src` attribute to `data-src` +* Prepare images in HTML for lazy loading by renaming the `src` attribute to `data-src` AND adding the class `lazy` * If you are using the Rails `image_tag` helper, all images will be lazy-loaded by default unless `lazy: false` is provided. If you are asynchronously adding content which contains lazy images then you need to call the function -`gl.lazyLoader.searchLazyImages()` which will search for lazy images and load them if needed. +`gl.lazyLoader.searchLazyImages()` which will search for lazy images and load them if needed. +But in general it should be handled automatically through a `MutationObserver` in the lazy loading function. ## Reducing Asset Footprint |