function CKEditorAdminSortTrait::sortableUpdate

Same name and namespace in other branches
  1. 9 core/modules/ckeditor/tests/src/Traits/CKEditorAdminSortTrait.php \Drupal\Tests\ckeditor\Traits\CKEditorAdminSortTrait::sortableUpdate()

Define to provide any necessary callback following layout change.

Parameters

string $item: The HTML selector for the element to be moved.

string $from: The HTML selector for the previous container element.

null|string $to: The HTML selector for the target container.

Overrides SortableTestTrait::sortableUpdate

File

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

Class

CKEditorAdminSortTrait
Provides callback for simulated CKEditor toolbar configuration change.

Namespace

Drupal\Tests\ckeditor\Traits

Code

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);
}

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