From 1f874c59d2bdbbd0eeee227f8a7f79587bf0ad44 Mon Sep 17 00:00:00 2001 From: Happy-melon Date: Sun, 27 Mar 2011 22:45:32 +0000 Subject: [PATCH] Follow-up r83907: abstract the flatlist mode into a descriptor option, and make it so the label does not linewrap away from the checkbox. --- includes/HTMLForm.php | 10 +++++++++- includes/specials/SpecialBlockList.php | 2 +- skins/common/shared.css | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/includes/HTMLForm.php b/includes/HTMLForm.php index 377783b065..58c8bbf97d 100644 --- a/includes/HTMLForm.php +++ b/includes/HTMLForm.php @@ -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 .= ' ' . 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 ); } } diff --git a/includes/specials/SpecialBlockList.php b/includes/specials/SpecialBlockList.php index 79cb97b40e..64245ba727 100644 --- a/includes/specials/SpecialBlockList.php +++ b/includes/specials/SpecialBlockList.php @@ -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 ); diff --git a/skins/common/shared.css b/skins/common/shared.css index e54fe3ad0e..9a8a1b5534 100644 --- a/skins/common/shared.css +++ b/skins/common/shared.css @@ -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 { -- 2.20.1