From: Glaisher Date: Thu, 12 Nov 2015 05:15:40 +0000 (+0500) Subject: Special:Contribs: autofocus to 'target' if target hasn't been specified or in non... X-Git-Tag: 1.31.0-rc.0~8861 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=84ab0088411ea56bfca77741cc649ceca31c25ee Special:Contribs: autofocus to 'target' if target hasn't been specified or in non-newbies mode Target field doesn't work in newbies mode so users doesn't need to enter in that field newbies mode also. This is not a huge issue normally but annoying when you're on a tablet or mobile where the autofocus makes the screen keyboard be shown when you visit the page. Bug: T117397 Change-Id: Ic6fd2fb2421325f748fccb2a5432e7713d0dcbb0 --- diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 81668e1250..5f7c587dd9 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -517,8 +517,13 @@ class SpecialContributions extends IncludableSpecialPage { 'mw-ui-input-inline', 'mw-autocomplete-user', // used by mediawiki.userSuggest ), - ) + ( $this->opts['target'] ? array() : array( 'autofocus' ) ) + ) + ( + // Only autofocus if target hasn't been specified or in non-newbies mode + ( $this->opts['contribs'] === 'newbie' || $this->opts['target'] ) + ? array() : array( 'autofocus' => true ) + ) ); + $targetSelection = Html::rawElement( 'td', array( 'colspan' => 2 ),