Fix regression in r49790, weird spacing for Gadgets and Skin tab.
authorAndrew Garrett <werdna@users.mediawiki.org>
Mon, 27 Apr 2009 14:18:40 +0000 (14:18 +0000)
committerAndrew Garrett <werdna@users.mediawiki.org>
Mon, 27 Apr 2009 14:18:40 +0000 (14:18 +0000)
includes/DefaultSettings.php
includes/HTMLForm.php
skins/common/shared.css

index 26b6684..498d869 100644 (file)
@@ -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:
index 42fca0e..89ef72a 100644 (file)
@@ -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() != '&nbsp;')
+                                       $hasLeftColumn = true;
                        } elseif ( is_array( $value ) ) {
                                $section = $this->displaySection( $value );
                                $legend = wfMsg( "{$this->mMessagePrefix}-$key" );
@@ -285,7 +289,12 @@ class HTMLForm {
                        }
                }
                
-               $tableHtml = "<table><tbody>\n$tableHtml\n</tbody></table>\n";
+               $classes = array();
+               if (!$hasLeftColumn) // Avoid strange spacing when no labels exist
+                       $classes[] = 'mw-htmlform-nolabel';
+               $classes = implode( ' ', $classes );
+               
+               $tableHtml = "<table class='$classes'><tbody>\n$tableHtml\n</tbody></table>\n";
                
                return $subsectionHtml . "\n" . $tableHtml;
        }
index 0de7773..d939666 100644 (file)
@@ -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
  */