protected function ConditionalFieldsFormHelper::addJavascriptEffects in Conditional Fields 8
Same name and namespace in other branches
- 4.x src/ConditionalFieldsFormHelper.php \Drupal\conditional_fields\ConditionalFieldsFormHelper::addJavascriptEffects()
Add our Javascript and effects.
File
- src/
ConditionalFieldsFormHelper.php, line 145
Class
- ConditionalFieldsFormHelper
- Helper to interact with forms.
Namespace
Drupal\conditional_fieldsCode
protected function addJavascriptEffects() {
$this->form['#attached']['library'][] = 'conditional_fields/conditional_fields';
// Add effect settings to the form.
if ($this->effects) {
$this->form['#attached']['drupalSettings']['conditionalFields'] = [
'effects' => $this->effects,
];
}
return $this;
}