From: umherirrender Date: Fri, 19 Jun 2015 15:45:23 +0000 (+0200) Subject: Fix tooltip for invert checkbox on Special:NewPages X-Git-Tag: 1.31.0-rc.0~11039 X-Git-Url: http://git.cyclocoop.org/data/%24self?a=commitdiff_plain;h=3169b369e0bd52f94d983a527c00e923cca9b0db;p=lhc%2Fweb%2Fwiklou.git Fix tooltip for invert checkbox on Special:NewPages Tooltip has to be a 'name', not a parsed message, because it goes through Linker::getTooltipAndAccessKey Also propagate tooltip from the checkbox to the label to have a bigger area for the mouse to trigger the tooltip. This is usally done for other checkboxes on Special:Watchlist. Follow-Up: I5c03dc543b910aab27a26a5a223341be50893cf3 Change-Id: If8dd9d66f57f63afe5df02d0d6b4cf70ba5d91c3 --- diff --git a/includes/htmlform/HTMLCheckField.php b/includes/htmlform/HTMLCheckField.php index 90293f460f..dc2de65f08 100644 --- a/includes/htmlform/HTMLCheckField.php +++ b/includes/htmlform/HTMLCheckField.php @@ -20,9 +20,15 @@ class HTMLCheckField extends HTMLFormField { $attr['class'] = $this->mClass; } + $attrLabel = array( 'for' => $this->mID ); + if ( isset( $attr['title'] ) ) { + // propagate tooltip to label + $attrLabel['title'] = $attr['title']; + } + $chkLabel = Xml::check( $this->mName, $value, $attr ) . ' ' - . Html::rawElement( 'label', array( 'for' => $this->mID ), $this->mLabel ); + . Html::rawElement( 'label', $attrLabel, $this->mLabel ); if ( $wgUseMediaWikiUIEverywhere || $this->mParent instanceof VFormHTMLForm ) { $chkLabel = Html::rawElement( diff --git a/includes/specials/SpecialNewpages.php b/includes/specials/SpecialNewpages.php index 899c7368fc..4e8a3ab12a 100644 --- a/includes/specials/SpecialNewpages.php +++ b/includes/specials/SpecialNewpages.php @@ -233,7 +233,7 @@ class SpecialNewpages extends IncludableSpecialPage { 'name' => 'invert', 'label-message' => 'invert', 'default' => $nsinvert, - 'tooltip' => $this->msg( 'tooltip-invert' )->text(), + 'tooltip' => 'invert', ), 'tagFilter' => array( 'type' => 'tagfilter',