Commit 09b1d9bc authored by webchick's avatar webchick

Issue #2547917 by Jelle_S, attiks: Add states API / ajax update for the breakpoint group form

parent 105518a2
......@@ -100,6 +100,17 @@ public function form(array $form, FormStateInterface $form_state) {
'#options' => $this->breakpointManager->getGroups(),
'#required' => TRUE,
'#description' => $description,
'#ajax' => array(
'callback' => '::breakpointMappingFormAjax',
'wrapper' => 'responsive-image-style-breakpoints-wrapper',
),
);
$form['keyed_styles'] = array(
'#type' => 'container',
'#attributes' => array(
'id' => 'responsive-image-style-breakpoints-wrapper',
),
);
// By default, breakpoints are ordered from smallest weight to largest:
......@@ -191,6 +202,13 @@ public function form(array $form, FormStateInterface $form_state) {
return parent::form($form, $form_state, $responsive_image_style);
}
/**
* Get the form for mapping breakpoints to image styles.
*/
public function breakpointMappingFormAjax($form, FormStateInterface $form_state) {
return $form['keyed_styles'];
}
/**
* {@inheritdoc}
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment