From f43bcb7b557a8aab5a89cd1996cc7bb6b900e9da Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Mon, 27 Apr 2009 14:18:40 +0000 Subject: [PATCH] Fix regression in r49790, weird spacing for Gadgets and Skin tab. --- includes/DefaultSettings.php | 2 +- includes/HTMLForm.php | 11 ++++++++++- skins/common/shared.css | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 26b6684eb5..498d86989f 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1477,7 +1477,7 @@ $wgCacheEpoch = '20030516000000'; * to ensure that client-side caches don't keep obsolete copies of global * styles. */ -$wgStyleVersion = '213'; +$wgStyleVersion = '214'; # Server-side caching: diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index 42fca0eb42..89ef72a79a 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -271,6 +271,7 @@ class HTMLForm { function displaySection( $fields ) { $tableHtml = ''; $subsectionHtml = ''; + $hasLeftColumn = false; foreach( $fields as $key => $value ) { if ( is_object( $value ) ) { @@ -278,6 +279,9 @@ class HTMLForm { ? $this->mFieldData[$key] : $value->getDefault(); $tableHtml .= $value->getTableRow( $v ); + + if ($value->getLabel() != ' ') + $hasLeftColumn = true; } elseif ( is_array( $value ) ) { $section = $this->displaySection( $value ); $legend = wfMsg( "{$this->mMessagePrefix}-$key" ); @@ -285,7 +289,12 @@ class HTMLForm { } } - $tableHtml = "\n$tableHtml\n
\n"; + $classes = array(); + if (!$hasLeftColumn) // Avoid strange spacing when no labels exist + $classes[] = 'mw-htmlform-nolabel'; + $classes = implode( ' ', $classes ); + + $tableHtml = "\n$tableHtml\n
\n"; return $subsectionHtml . "\n" . $tableHtml; } diff --git a/skins/common/shared.css b/skins/common/shared.css index 0de7773f0f..d939666266 100644 --- a/skins/common/shared.css +++ b/skins/common/shared.css @@ -77,6 +77,8 @@ body.rtl td.mw-submit { text-align: right; } td.mw-label { vertical-align: top; width: 20%; } td.mw-submit { white-space: nowrap; } +table.mw-htmlform-nolabel td.mw-label { width: 0 !important; } + /** * Image captions */ -- 2.20.1