jenkins-bot has submitted this change and it was merged.

Change subject: Fix gallery rearrange on resize with missing images
......................................................................


Fix gallery rearrange on resize with missing images

Follow-ups I286e0a4c8230c11619ca30f8f3b66778de835a33

Bug: T55664
Change-Id: I95cc64de11df3197378f4873d62a76333d55b452
---
M resources/src/mediawiki.page/mediawiki.page.gallery.js
1 file changed, 6 insertions(+), 2 deletions(-)

Approvals:
  Fomafix: Looks good to me, but someone else must approve
  Bartosz Dziewoński: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/src/mediawiki.page/mediawiki.page.gallery.js 
b/resources/src/mediawiki.page/mediawiki.page.gallery.js
index e3ffbda..e4cd3a2 100644
--- a/resources/src/mediawiki.page/mediawiki.page.gallery.js
+++ b/resources/src/mediawiki.page/mediawiki.page.gallery.js
@@ -222,12 +222,14 @@
                                        imgHeight = $( this ).data( 'imgHeight' 
),
                                        width = $( this ).data( 'width' ),
                                        captionWidth = $( this ).data( 
'captionWidth' ),
+                                       $innerDiv = $( this ).children( 'div' 
).first(),
+                                       $imageDiv = $innerDiv.children( 
'div.thumb' ),
                                        $imageElm, imageElm;
 
                                // Restore original sizes so we can arrange the 
elements as on freshly loaded page
                                $( this ).width( width );
-                               $( this ).children( 'div' ).first().width( 
width );
-                               $( this ).children( 'div' ).first().children( 
'div.thumb' ).width( imgWidth );
+                               $innerDiv.width( width );
+                               $imageDiv.width( imgWidth );
                                $( this ).find( 'div.gallerytextwrapper' 
).width( captionWidth );
 
                                $imageElm = $( this ).find( 'img' ).first();
@@ -235,6 +237,8 @@
                                if ( imageElm ) {
                                        imageElm.width = imgWidth;
                                        imageElm.height = imgHeight;
+                               } else {
+                                       $imageDiv.height( imgHeight );
                                }
                        } );
                } ) );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I95cc64de11df3197378f4873d62a76333d55b452
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: M4tx <m...@m4tx.pl>
Gerrit-Reviewer: Bartosz Dziewoński <matma....@gmail.com>
Gerrit-Reviewer: Fomafix
Gerrit-Reviewer: Jack Phoenix <j...@countervandalism.net>
Gerrit-Reviewer: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to