gallery.js: Do not resize gallery caption
authorFomafix <fomafix@googlemail.com>
Mon, 2 Nov 2015 05:50:57 +0000 (05:50 +0000)
committerJdlrobson <jrobson@wikimedia.org>
Tue, 3 Nov 2015 01:15:45 +0000 (01:15 +0000)
Resize only gallerybox which contains resized images.

Bug: T91075
Change-Id: Idcaf22fbaabaa26c8d06f5dd0194d4ed7c7b1a60

resources/src/mediawiki/page/gallery.js

index dfccf21..79937e5 100644 (file)
@@ -25,7 +25,7 @@
                        rows = [],
                        $gallery = $( this );
 
-               $gallery.children( 'li' ).each( function () {
+               $gallery.children( 'li.gallerybox' ).each( function () {
                        // Math.floor to be paranoid if things are off by 0.00000000001
                        var top = Math.floor( $( this ).position().top ),
                                $this = $( this );
        }
 
        function handleResizeStart() {
-               $galleries.children( 'li' ).each( function () {
+               $galleries.children( 'li.gallerybox' ).each( function () {
                        var imgWidth = $( this ).data( 'imgWidth' ),
                                imgHeight = $( this ).data( 'imgHeight' ),
                                width = $( this ).data( 'width' ),