Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for lazy loading images #703

Merged
merged 4 commits into from Sep 3, 2019

Conversation

@ausi
Copy link
Member

commented Sep 1, 2019

See #433

I only added support for loading="lazy" for now because eager and auto don’t change the default browser behavior currently.

@ausi ausi added the feature label Sep 1, 2019

@ausi ausi self-assigned this Sep 1, 2019

<source>Enable lazy loading</source>
</trans-unit>
<trans-unit id="tl_image_size.lazyLoading.1">
<source>Adds loading=&amp;quot;lazy&amp;quot; to the &amp;lt;img&amp;gt; tag to defer loading the image until it is scrolled into the viewport.</source>

This comment has been minimized.

Copy link
@xchs

xchs Sep 1, 2019

Contributor

Couldn't you also just write & instead of &amp; here?

This comment has been minimized.

Copy link
@ausi

ausi Sep 1, 2019

Author Member

No. I tried. Doesn’t work with &lt;img&gt;.

This comment has been minimized.

Copy link
@xchs

xchs Sep 1, 2019

Contributor

I see. Here too, for example: https://github.com/contao/contao/blob/master/core-bundle/src/Resources/contao/languages/en/explain.xlf#L81

That's curious. What's so special with &lt;img&gt;, because it seems to work with all other elements?

This comment has been minimized.

Copy link
@ausi

ausi Sep 2, 2019

Author Member

In your example the output results in an actual <code> tag, but here we don’t want an actual <img> tag but “<img>” as text instead.

@leofeyer leofeyer added this to the 4.9 milestone Sep 1, 2019

@leofeyer leofeyer merged commit e8b8677 into contao:master Sep 3, 2019

3 checks passed

Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
coverage/coveralls Coverage increased (+0.02%) to 86.227%
Details
@leofeyer

This comment has been minimized.

Copy link
Member

commented Sep 3, 2019

Thank you @ausi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.