Issue #2650994 by drunken monkey: Javascript states not working for boolean fields
parent
e86e73481e
commit
96dc1923e3
|
@ -83,6 +83,7 @@ class BooleanFormatter extends FormatterBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$field_name = $this->fieldDefinition->getName();
|
||||||
$form['format'] = [
|
$form['format'] = [
|
||||||
'#type' => 'select',
|
'#type' => 'select',
|
||||||
'#title' => $this->t('Output format'),
|
'#title' => $this->t('Output format'),
|
||||||
|
@ -95,7 +96,7 @@ class BooleanFormatter extends FormatterBase {
|
||||||
'#default_value' => $this->getSetting('format_custom_true'),
|
'#default_value' => $this->getSetting('format_custom_true'),
|
||||||
'#states' => [
|
'#states' => [
|
||||||
'visible' => [
|
'visible' => [
|
||||||
'select[name="fields[field_boolean][settings_edit_form][settings][format]"]' => ['value' => 'custom'],
|
'select[name="fields[' . $field_name . '][settings_edit_form][settings][format]"]' => ['value' => 'custom'],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
@ -105,7 +106,7 @@ class BooleanFormatter extends FormatterBase {
|
||||||
'#default_value' => $this->getSetting('format_custom_false'),
|
'#default_value' => $this->getSetting('format_custom_false'),
|
||||||
'#states' => [
|
'#states' => [
|
||||||
'visible' => [
|
'visible' => [
|
||||||
'select[name="fields[field_boolean][settings_edit_form][settings][format]"]' => ['value' => 'custom'],
|
'select[name="fields[' . $field_name . '][settings_edit_form][settings][format]"]' => ['value' => 'custom'],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
|
@ -131,7 +131,7 @@ class TimestampFormatter extends FormatterBase implements ContainerFactoryPlugin
|
||||||
);
|
);
|
||||||
|
|
||||||
$elements['custom_date_format']['#states']['visible'][] = array(
|
$elements['custom_date_format']['#states']['visible'][] = array(
|
||||||
':input[name="options[settings][date_format]"]' => array('value' => 'custom'),
|
':input[name="name="fields[' . $this->fieldDefinition->getName() . '][settings_edit_form][settings][date_format]"]' => array('value' => 'custom'),
|
||||||
);
|
);
|
||||||
|
|
||||||
$elements['timezone'] = array(
|
$elements['timezone'] = array(
|
||||||
|
|
Loading…
Reference in New Issue