You are here

trait CKEditorAdminSortTrait in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/ckeditor/tests/src/Traits/CKEditorAdminSortTrait.php \Drupal\Tests\ckeditor\Traits\CKEditorAdminSortTrait

Provides callback for simulated CKEditor toolbar configuration change.

Hierarchy

1 file declares its use of CKEditorAdminSortTrait
CKEditorIntegrationTest.php in core/modules/media_library/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php

File

core/modules/ckeditor/tests/src/Traits/CKEditorAdminSortTrait.php, line 10

Namespace

Drupal\Tests\ckeditor\Traits
View source
trait CKEditorAdminSortTrait {
  use SortableTestTrait;

  /**
   * {@inheritdoc}
   */
  protected function sortableUpdate($item, $from, $to = NULL) {
    $script = <<<JS
(function () {
  // Set backbone model after a DOM change.
  Drupal.ckeditor.models.Model.set('isDirty', true);
})()

JS;
    $options = [
      'script' => $script,
      'args' => [],
    ];
    $this
      ->getSession()
      ->getDriver()
      ->getWebDriverSession()
      ->execute($options);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CKEditorAdminSortTrait::sortableUpdate protected function Define to provide any necessary callback following layout change. Overrides SortableTestTrait::sortableUpdate
SortableTestTrait::sortableAfter protected function Simulates a drag moving an element after its sibling in the same container.
SortableTestTrait::sortableTo protected function Simulates a drag on an element from one container to another.