Disabled property on form fields should work

This commit is contained in:
Samuel Georges 2015-02-21 17:09:21 +11:00
parent 25963deb69
commit c746ba5c2b
1 changed files with 20 additions and 1 deletions

View File

@ -366,12 +366,31 @@ class FormField
/**
* Adds any circumstantial attributes to the field based on other
* settings, such as the 'trigger' option.
* settings, such as the 'disabled' option.
* @param array $attributes
* @param string $position
* @return array
*/
protected function filterAttributes($attributes, $position = 'field')
{
$position = strtolower($position);
$attributes = $this->filterTriggerAttributes($attributes, $position);
if ($position == 'field' && $this->disabled) {
$attributes = $attributes + ['disabled' => 'disabled'];
}
return $attributes;
}
/**
* Adds attribues used specifically by the TriggerAPI
* @param array $attributes
* @param string $position
* @return array
*/
protected function filterTriggerAttributes($attributes, $position = 'field')
{
if (!$this->trigger || !is_array($this->trigger))
return $attributes;