From: umherirrender Date: Sun, 27 Apr 2014 11:29:06 +0000 (+0200) Subject: Set autofocus on Special:Unblock X-Git-Tag: 1.31.0-rc.0~14997^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/supprimer.php?a=commitdiff_plain;h=018ae5246007f4ed92067c607d3c050bb1bedf15;p=lhc%2Fweb%2Fwiklou.git Set autofocus on Special:Unblock Replaced the tabindex=1 with autofocus to have the cursor in the target field. This is than also the start for tabs and therefor no tabindex is needed. In case of a valid block the autofocus is moved to the reason field, because the target field gets hidden. Change-Id: I1c35f546ad22907ab824b6c51fd65655f1a91a96 --- diff --git a/includes/specials/SpecialUnblock.php b/includes/specials/SpecialUnblock.php index 797543f4da..96e4dbfd01 100644 --- a/includes/specials/SpecialUnblock.php +++ b/includes/specials/SpecialUnblock.php @@ -83,7 +83,7 @@ class SpecialUnblock extends SpecialPage { 'Target' => array( 'type' => 'text', 'label-message' => 'ipaddressorusername', - 'tabindex' => '1', + 'autofocus' => true, 'size' => '45', 'required' => true, ), @@ -131,6 +131,9 @@ class SpecialUnblock extends SpecialPage { $fields['Target']['default'] = "#{$this->target}"; break; } + // target is hidden, so the reason is the first element + $fields['Target']['autofocus'] = false; + $fields['Reason']['autofocus'] = true; } } else { $fields['Target']['default'] = $this->target;