[MediaWiki-commits] [Gerrit] Fix gallery rearrange on resize with missing images - change (mediawiki/core)

2015-01-10 Thread jenkins-bot (Code Review)
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


[MediaWiki-commits] [Gerrit] Fix gallery rearrange on resize with missing images - change (mediawiki/core)

2015-01-09 Thread M4tx (Code Review)
M4tx has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/183989

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

Fix gallery rearrange on resize with missing images

Bug: T55664
Follow-ups I286e0a4c8230c11619ca30f8f3b66778de835a33

Change-Id: I95cc64de11df3197378f4873d62a76333d55b452
---
M resources/src/mediawiki.page/mediawiki.page.gallery.js
1 file changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/89/183989/1

diff --git a/resources/src/mediawiki.page/mediawiki.page.gallery.js 
b/resources/src/mediawiki.page/mediawiki.page.gallery.js
index ba1f323..5be1fea 100644
--- a/resources/src/mediawiki.page/mediawiki.page.gallery.js
+++ b/resources/src/mediawiki.page/mediawiki.page.gallery.js
@@ -221,12 +221,14 @@
var imgWidth = $( this ).data( 'imgWidth' ),
imgHeight = $( this ).data( 'imgHeight' 
),
width = $( this ).data( 'width' ),
-   captionWidth = $( this ).data( 
'captionWidth' );
+   captionWidth = $( this ).data( 
'captionWidth' ),
+   $innerDiv = $( this ).children( 'div' 
).first(),
+   $imageDiv = $innerDiv.children( 
'div.thumb' );
 
// 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 );
 
var $imageElm = $( this ).find( 'img' ).first(),
@@ -234,6 +236,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: newchange
Gerrit-Change-Id: I95cc64de11df3197378f4873d62a76333d55b452
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: M4tx m...@m4tx.pl

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