Brian Wolff has uploaded a new change for review.
https://gerrit.wikimedia.org/r/80683
Change subject: [New gallery] ignore perrow option in this mode, as doesn't
make sense.
......................................................................
[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
---
M includes/gallery/NolinesImageGallery.php
M includes/gallery/PackedImageGallery.php
2 files changed, 16 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/83/80683/1
diff --git a/includes/gallery/NolinesImageGallery.php
b/includes/gallery/NolinesImageGallery.php
index 9e0a494..6b0d0fa 100644
--- a/includes/gallery/NolinesImageGallery.php
+++ b/includes/gallery/NolinesImageGallery.php
@@ -28,7 +28,8 @@
}
protected function getGBBorders() {
- return 0;
+ // This accounts for extra space between <li> elements.
+ return 4;
}
protected function getVPad( $boxHeight, $thumbHeight ) {
diff --git a/includes/gallery/PackedImageGallery.php
b/includes/gallery/PackedImageGallery.php
index 9149f8c..e042d0f 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 @@
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;
+ }
}
--
To view, visit https://gerrit.wikimedia.org/r/80683
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I99018e258d3eea93c8203cb0b6bb63bfed1c00b7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits