From 7c4308d62427d61b8b55f20400e5dbeab6dce62d Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Fri, 23 Aug 2013 16:22:06 -0700 Subject: [PATCH] [New gallery] ignore perrow option in this mode, as doesn't make sense. gallery in packed resizes images to have same height. Since the images have dynamic height, its impossible to implement the perrow option using a width: css rule. Also fixes the option for the nolines mode, where it calculated the row length wrong. Change-Id: I99018e258d3eea93c8203cb0b6bb63bfed1c00b7 --- includes/gallery/NolinesImageGallery.php | 3 ++- includes/gallery/PackedImageGallery.php | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/includes/gallery/NolinesImageGallery.php b/includes/gallery/NolinesImageGallery.php index 9e0a494047..6b0d0fa63b 100644 --- a/includes/gallery/NolinesImageGallery.php +++ b/includes/gallery/NolinesImageGallery.php @@ -28,7 +28,8 @@ class NolinesImageGallery extends TraditionalImageGallery { } protected function getGBBorders() { - return 0; + // This accounts for extra space between
  • elements. + return 4; } protected function getVPad( $boxHeight, $thumbHeight ) { diff --git a/includes/gallery/PackedImageGallery.php b/includes/gallery/PackedImageGallery.php index 9149f8cead..e042d0f494 100644 --- a/includes/gallery/PackedImageGallery.php +++ b/includes/gallery/PackedImageGallery.php @@ -22,6 +22,12 @@ 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; + } } -- 2.20.1