Follow-up r83907: abstract the flatlist mode into a descriptor option, and make it...
authorHappy-melon <happy-melon@users.mediawiki.org>
Sun, 27 Mar 2011 22:45:32 +0000 (22:45 +0000)
committerHappy-melon <happy-melon@users.mediawiki.org>
Sun, 27 Mar 2011 22:45:32 +0000 (22:45 +0000)
includes/HTMLForm.php
includes/specials/SpecialBlockList.php
skins/common/shared.css

index 377783b..58c8bbf 100644 (file)
@@ -1403,6 +1403,14 @@ class HTMLSelectOrOtherField extends HTMLTextField {
  * Multi-select field
  */
 class HTMLMultiSelectField extends HTMLFormField {
+
+       public function __construct( $params ){
+               parent::__construct( $params );
+               if( isset( $params['flatlist'] ) ){
+                       $this->mClass .= ' mw-htmlform-multiselect-flatlist';
+               }
+       }
+
        function validate( $value, $alldata ) {
                $p = parent::validate( $value, $alldata );
 
@@ -1454,7 +1462,7 @@ class HTMLMultiSelectField extends HTMLFormField {
                                        $attribs + $thisAttribs );
                                $checkbox .= '&#160;' . Html::rawElement( 'label', array( 'for' => "{$this->mID}-$info" ), $label );
 
-                               $html .= Html::rawElement( 'div', array( 'class' => 'mw-htmlform-multiselect-item' ), $checkbox );
+                               $html .= ' ' . Html::rawElement( 'div', array( 'class' => 'mw-htmlform-multiselect-item' ), $checkbox );
                        }
                }
 
index 79cb97b..64245ba 100644 (file)
@@ -76,7 +76,7 @@ class SpecialBlockList extends SpecialPage {
                                        wfMsg( 'blocklist-tempblocks' ) => 'tempblocks',
                                        wfMsg( 'blocklist-addressblocks' ) => 'addressblocks',
                                ),
-                               'cssclass' => 'mw-htmlform-multiselect-flatlist',
+                               'flatlist' => true,
                        ),
                );
                $form = new HTMLForm( $fields );
index e54fe3a..9a8a1b5 100644 (file)
@@ -129,6 +129,7 @@ tr.mw-htmlform-vertical-label td.mw-label {
 .mw-htmlform-multiselect-flatlist div.mw-htmlform-multiselect-item {
        display: inline;
        margin-right: 1em;
+       white-space: nowrap;
 }
 
 input#wpSummary {