From 3169b369e0bd52f94d983a527c00e923cca9b0db Mon Sep 17 00:00:00 2001 From: umherirrender Date: Fri, 19 Jun 2015 17:45:23 +0200 Subject: [PATCH] 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 --- includes/htmlform/HTMLCheckField.php | 8 +++++++- includes/specials/SpecialNewpages.php | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) 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', -- 2.20.1