CKEditorAdminSortTrait.php

Same filename in other branches
  1. 8.9.x core/modules/ckeditor/tests/src/Traits/CKEditorAdminSortTrait.php

Namespace

Drupal\Tests\ckeditor\Traits

File

core/modules/ckeditor/tests/src/Traits/CKEditorAdminSortTrait.php

View source
<?php

namespace Drupal\Tests\ckeditor\Traits;

use Drupal\FunctionalJavascriptTests\SortableTestTrait;

/**
 * Provides callback for simulated CKEditor toolbar configuration change.
 */
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);
    }

}

Traits

Title Deprecated Summary
CKEditorAdminSortTrait Provides callback for simulated CKEditor toolbar configuration change.

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