Pass along the disabled parameter to HTMLFormFieldCloner
If the disabled parameter is set, the create/delete buttons should be disabled by default. If a delete button is passed along, then it overwrites the default delete button and therefore needs to manage its own disabled/enabled state Bug: T273431 Change-Id: Ia424466d26b6f65f01b912c2d556d329eb93f29a
This commit is contained in:
parent
9682c21bc7
commit
a7d20495e9
1 changed files with 2 additions and 0 deletions
|
|
@ -367,6 +367,7 @@ class HTMLFormFieldCloner extends HTMLFormField {
|
|||
'id' => Sanitizer::escapeIdForAttribute( "{$this->mID}--$key--delete" ),
|
||||
'cssclass' => 'mw-htmlform-cloner-delete-button',
|
||||
'default' => $this->getMessage( $label )->text(),
|
||||
'disabled' => $this->mParams['disabled'] ?? false,
|
||||
], $this->mParent );
|
||||
return $field;
|
||||
}
|
||||
|
|
@ -381,6 +382,7 @@ class HTMLFormFieldCloner extends HTMLFormField {
|
|||
'id' => Sanitizer::escapeIdForAttribute( "{$this->mID}--create" ),
|
||||
'cssclass' => 'mw-htmlform-cloner-create-button',
|
||||
'default' => $this->getMessage( $label )->text(),
|
||||
'disabled' => $this->mParams['disabled'] ?? false,
|
||||
], $this->mParent );
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue