trait CKEditorAdminSortTrait

Same name and namespace in other branches
  1. 8.9.x 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
MediaLibraryTest.php in core/modules/ckeditor/tests/src/FunctionalJavascript/MediaLibraryTest.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

Title Sort descending Modifiers Object type Summary Overriden Title
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.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.