mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Comfortable focus setting on login mask
* Needs improvement once we have better forms
This commit is contained in:
parent
715cad86d5
commit
29f007e537
@ -54,9 +54,7 @@ class LoginForm extends Form
|
|||||||
array(
|
array(
|
||||||
'required' => true,
|
'required' => true,
|
||||||
'placeholder' => t('Username'),
|
'placeholder' => t('Username'),
|
||||||
'class' => 'autofocus'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->addElement(
|
$this->addElement(
|
||||||
@ -67,7 +65,13 @@ class LoginForm extends Form
|
|||||||
'required' => true
|
'required' => true
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
$user = $this->getElement('username');
|
||||||
|
// TODO: We need a place to intercept filled forms before rendering
|
||||||
|
if (isset($_POST['username'])) {
|
||||||
|
$this->getElement('password')->setAttrib('class', 'autofocus');
|
||||||
|
} else {
|
||||||
|
$user->setAttrib('class', 'autofocus');
|
||||||
|
}
|
||||||
$this->setSubmitLabel('Login');
|
$this->setSubmitLabel('Login');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user