r49955 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49954‎ | r49955 | r49956 >
Date:14:18, 27 April 2009
Author:werdna
Status:ok
Tags:
Comment:
Fix regression in r49790, weird spacing for Gadgets and Skin tab.
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/HTMLForm.php (modified) (history)
  • /trunk/phase3/skins/common/shared.css (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/shared.css
@@ -77,6 +77,8 @@
7878 td.mw-label { vertical-align: top; width: 20%; }
7979 td.mw-submit { white-space: nowrap; }
8080
 81+table.mw-htmlform-nolabel td.mw-label { width: 0 !important; }
 82+
8183 /**
8284 * Image captions
8385 */
Index: trunk/phase3/includes/HTMLForm.php
@@ -271,6 +271,7 @@
272272 function displaySection( $fields ) {
273273 $tableHtml = '';
274274 $subsectionHtml = '';
 275+ $hasLeftColumn = false;
275276
276277 foreach( $fields as $key => $value ) {
277278 if ( is_object( $value ) ) {
@@ -278,6 +279,9 @@
279280 ? $this->mFieldData[$key]
280281 : $value->getDefault();
281282 $tableHtml .= $value->getTableRow( $v );
 283+
 284+ if ($value->getLabel() != ' ')
 285+ $hasLeftColumn = true;
282286 } elseif ( is_array( $value ) ) {
283287 $section = $this->displaySection( $value );
284288 $legend = wfMsg( "{$this->mMessagePrefix}-$key" );
@@ -285,8 +289,13 @@
286290 }
287291 }
288292
289 - $tableHtml = "<table><tbody>\n$tableHtml\n</tbody></table>\n";
 293+ $classes = array();
 294+ if (!$hasLeftColumn) // Avoid strange spacing when no labels exist
 295+ $classes[] = 'mw-htmlform-nolabel';
 296+ $classes = implode( ' ', $classes );
290297
 298+ $tableHtml = "<table class='$classes'><tbody>\n$tableHtml\n</tbody></table>\n";
 299+
291300 return $subsectionHtml . "\n" . $tableHtml;
292301 }
293302
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1477,7 +1477,7 @@
14781478 * to ensure that client-side caches don't keep obsolete copies of global
14791479 * styles.
14801480 */
1481 -$wgStyleVersion = '213';
 1481+$wgStyleVersion = '214';
14821482
14831483
14841484 # Server-side caching:

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r49790Branch merge of preferences work branch. Includes fixes for several bugs. WAR...werdna01:31, 24 April 2009

Status & tagging log