From: Happy-melon Date: Sun, 27 Mar 2011 22:45:32 +0000 (+0000) Subject: Follow-up r83907: abstract the flatlist mode into a descriptor option, and make it... X-Git-Tag: 1.31.0-rc.0~31153 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=1f874c59d2bdbbd0eeee227f8a7f79587bf0ad44;p=lhc%2Fweb%2Fwiklou.git Follow-up r83907: abstract the flatlist mode into a descriptor option, and make it so the label does not linewrap away from the checkbox. --- 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 {