jenkins-bot has submitted this change and it was merged.
Change subject: Pass class to the lazy loaded image
......................................................................
Pass class to the lazy loaded image
Bug: T129198
Change-Id: Id12505f5867ee2cf0def4572595aaa0afbe56b87
---
M includes/MobileFormatter.php
M resources/mobile.startup/Skin.js
2 files changed, 2 insertions(+), 1 deletion(-)
Approvals:
Bmansurov: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/MobileFormatter.php b/includes/MobileFormatter.php
index 2f248e4..b4aa8e6 100644
--- a/includes/MobileFormatter.php
+++ b/includes/MobileFormatter.php
@@ -205,7 +205,7 @@
$imgPlaceholder = $doc->createElement( 'span' );
$imgPlaceholder->setAttribute( 'class',
'lazy-image-placeholder' );
$imgPlaceholder->setAttribute( 'style',
$dimensionsStyle );
- foreach ( [ 'src', 'alt', 'width', 'height', 'srcset' ]
as $attr ) {
+ foreach ( [ 'src', 'alt', 'width', 'height', 'srcset',
'class' ] as $attr ) {
if ( $img->hasAttribute( $attr ) ) {
$imgPlaceholder->setAttribute(
"data-$attr", $img->getAttribute( $attr ) );
}
diff --git a/resources/mobile.startup/Skin.js b/resources/mobile.startup/Skin.js
index 0d5442b..9ef849b 100644
--- a/resources/mobile.startup/Skin.js
+++ b/resources/mobile.startup/Skin.js
@@ -245,6 +245,7 @@
// Trigger image download after binding the load handler
$downloadingImage.attr( {
+ 'class': $placeholder.attr( 'data-class' ),
width: width,
height: height,
src: $placeholder.attr( 'data-src' ),
--
To view, visit https://gerrit.wikimedia.org/r/277570
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id12505f5867ee2cf0def4572595aaa0afbe56b87
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Bmansurov <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits