diff --git a/core/lib/Drupal/Core/Entity/EntityForm.php b/core/lib/Drupal/Core/Entity/EntityForm.php index ae3b768..145e3aa 100644 --- a/core/lib/Drupal/Core/Entity/EntityForm.php +++ b/core/lib/Drupal/Core/Entity/EntityForm.php @@ -7,6 +7,7 @@ namespace Drupal\Core\Entity; +use Drupal\Component\Serialization\Json; use Drupal\Core\Form\FormBase; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Render\Element; @@ -234,6 +235,9 @@ protected function actions(array $form, array &$form_state) { '#attributes' => array( 'class' => array('button', 'button--danger', 'use-ajax'), 'data-accepts' => 'application/vnd.drupal-modal', + 'data-dialog-options' => Json::encode(array( + 'width' => 'auto', + )), ), ); $actions['delete'] += $route_info->toRenderArray(); diff --git a/core/lib/Drupal/Core/Form/ConfirmFormHelper.php b/core/lib/Drupal/Core/Form/ConfirmFormHelper.php index bd887d0..3ff5247 100644 --- a/core/lib/Drupal/Core/Form/ConfirmFormHelper.php +++ b/core/lib/Drupal/Core/Form/ConfirmFormHelper.php @@ -7,7 +7,6 @@ namespace Drupal\Core\Form; -use Drupal\Component\Serialization\Json; use Drupal\Component\Utility\String; use Drupal\Component\Utility\UrlHelper; use Drupal\Core\Url; @@ -65,9 +64,6 @@ public static function buildCancelLink(ConfirmFormInterface $form, Request $requ $link['#title'] = $form->getCancelText(); $link['#attributes'] = array( 'class' => array('dialog-cancel'), - 'data-dialog-options' => Json::encode(array( - 'width' => 'auto', - )), ); return $link;