Jdlrobson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/349717 )

Change subject: DONOTMERGE: Allow browser to progressively render images
......................................................................

DONOTMERGE: Allow browser to progressively render images

Change-Id: I0bb3a4866b8f5cd8dca9225b3226aa6fffdffde8
---
M resources/mobile.startup/Skin.js
1 file changed, 2 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/17/349717/1

diff --git a/resources/mobile.startup/Skin.js b/resources/mobile.startup/Skin.js
index cffdec1..19bd251 100644
--- a/resources/mobile.startup/Skin.js
+++ b/resources/mobile.startup/Skin.js
@@ -226,14 +226,6 @@
                                // Image will start downloading
                                $downloadingImage = $( '<img/>' );
 
-                       // When the image has loaded
-                       $downloadingImage.on( 'load', function () {
-                               // Swap the HTML inside the placeholder (to 
keep the layout and
-                               // dimensions the same and not trigger layouts
-                               $downloadingImage.addClass( 'image-lazy-loaded' 
);
-                               $placeholder.replaceWith( $downloadingImage );
-                       } );
-
                        // Trigger image download after binding the load handler
                        $downloadingImage.attr( {
                                'class': $placeholder.attr( 'data-class' ),
@@ -243,7 +235,8 @@
                                alt: $placeholder.attr( 'data-alt' ),
                                style: $placeholder.attr( 'style' ),
                                srcset: $placeholder.attr( 'data-srcset' )
-                       } );
+                       } ).addClass( 'image-lazy-loaded' );
+                       $placeholder.replaceWith( $downloadingImage );
                },
 
                /**

-- 
To view, visit https://gerrit.wikimedia.org/r/349717
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0bb3a4866b8f5cd8dca9225b3226aa6fffdffde8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to