commit 9781c74965c03f7be948098115b4fc1aa8e0e348 Author: Bart Feenstra Date: Tue Apr 29 10:15:27 2014 +0200 foo diff --git a/core/lib/Drupal/Core/Entity/EntityListBuilder.php b/core/lib/Drupal/Core/Entity/EntityListBuilder.php index b7b1347..80bc999 100644 --- a/core/lib/Drupal/Core/Entity/EntityListBuilder.php +++ b/core/lib/Drupal/Core/Entity/EntityListBuilder.php @@ -123,6 +123,10 @@ protected function getDefaultOperations(EntityInterface $entity) { $operations['delete'] = array( 'title' => $this->t('Delete'), 'weight' => 100, + 'attributes' => array( + 'class' => array('use-ajax'), + 'data-accepts' => 'application/vnd.drupal-modal', + ), ) + $entity->urlInfo('delete-form')->toArray(); } @@ -173,6 +177,10 @@ public function buildOperations(EntityInterface $entity) { $build = array( '#type' => 'operations', '#links' => $this->getOperations($entity), + // Allow links to use modals. + '#attached' => array( + 'library' => array('core/drupal.ajax'), + ), ); return $build; diff --git a/core/lib/Drupal/Core/Form/ConfirmFormHelper.php b/core/lib/Drupal/Core/Form/ConfirmFormHelper.php index 1b1fa30..3ff5247 100644 --- a/core/lib/Drupal/Core/Form/ConfirmFormHelper.php +++ b/core/lib/Drupal/Core/Form/ConfirmFormHelper.php @@ -62,6 +62,10 @@ public static function buildCancelLink(ConfirmFormInterface $form, Request $requ $link['#type'] = 'link'; $link['#title'] = $form->getCancelText(); + $link['#attributes'] = array( + 'class' => array('dialog-cancel'), + ); + return $link; }