Skip to content
Snippets Groups Projects
Commit 5516b0ae authored by Nicolas Ricklin's avatar Nicolas Ricklin Committed by Jonathan Sacksick
Browse files

Issue #3373469 by Aerzas: Adapt modal to content width.

parent d14a2eb5
Branches
Tags
1 merge request!26Draft: Automated Project Update Bot fixes
......@@ -2,6 +2,7 @@
namespace Drupal\state_machine\Form;
use Drupal\Component\Serialization\Json;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
......@@ -120,6 +121,9 @@ class StateTransitionForm extends FormBase implements StateTransitionFormInterfa
if ($form_state->get('use_modal')) {
$form['actions'][$transition_id]['#attributes']['class'][] = 'use-ajax';
$form['actions'][$transition_id]['#attributes']['data-dialog-type'] = 'modal';
$form['actions'][$transition_id]['#attributes']['data-dialog-options'] = Json::encode([
'width' => 'auto',
]);
$form['#attached']['library'][] = 'core/drupal.dialog.ajax';
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment