mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 06:44:33 +02:00
Auto-focus submit button in the confirm removal form
This commit is contained in:
parent
8a17cc5161
commit
0e4b9f1672
@ -11,11 +11,26 @@ use Icinga\Web\Form;
|
|||||||
class ConfirmRemovalForm extends Form
|
class ConfirmRemovalForm extends Form
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Initialize this form
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function init()
|
public function init()
|
||||||
{
|
{
|
||||||
$this->setName('form_confirm_removal');
|
$this->setName('form_confirm_removal');
|
||||||
$this->getSubmitLabel() ?: $this->setSubmitLabel($this->translate('Confirm Removal'));
|
$this->getSubmitLabel() ?: $this->setSubmitLabel($this->translate('Confirm Removal'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function addSubmitButton()
|
||||||
|
{
|
||||||
|
parent::addSubmitButton();
|
||||||
|
|
||||||
|
if (($submit = $this->getElement('btn_submit')) !== null) {
|
||||||
|
$class = $submit->getAttrib('class');
|
||||||
|
$submit->setAttrib('class', empty($class) ? 'autofocus' : $class . ' autofocus');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user