Merge "[New gallery] ignore perrow option in this mode, as doesn't make sense."
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 26 Aug 2013 18:28:20 +0000 (18:28 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 26 Aug 2013 18:28:20 +0000 (18:28 +0000)
includes/gallery/NolinesImageGallery.php
includes/gallery/PackedImageGallery.php

index 9e0a494..6b0d0fa 100644 (file)
@@ -28,7 +28,8 @@ class NolinesImageGallery extends TraditionalImageGallery {
        }
 
        protected function getGBBorders() {
-               return 0;
+               // This accounts for extra space between <li> elements.
+               return 4;
        }
 
        protected function getVPad( $boxHeight, $thumbHeight ) {
index 0095d34..963ee6b 100644 (file)
 
 class PackedImageGallery extends TraditionalImageGallery {
 
+       function __construct( $mode = 'traditional' ) {
+               parent::__construct( $mode );
+               // Does not support per row option.
+               $this->mPerRow = 0;
+       }
+
        /**
         * We artificially have 1.5 the resolution neccessary so that
         * we can scale it up by that much on the client side, without
@@ -88,4 +94,12 @@ class PackedImageGallery extends TraditionalImageGallery {
        protected function getModules() {
                return array( 'mediawiki.page.gallery' );
        }
+
+       /**
+        * Do not support per-row on packed. It really doesn't work
+        * since the images have varying widths.
+        */
+       public function setPerRow( $num ) {
+               return;
+       }
 }