protected function AjaxCssTest::waitOnCkeditorInstance in Drupal 8
Same name and namespace in other branches
- 9 core/modules/ckeditor/tests/src/FunctionalJavascript/AjaxCssTest.php \Drupal\Tests\ckeditor\FunctionalJavascript\AjaxCssTest::waitOnCkeditorInstance()
Wait for a CKEditor instance to finish loading and initializing.
Parameters
string $instance_id: The CKEditor instance ID.
int $timeout: (optional) Timeout in milliseconds, defaults to 10000.
1 call to AjaxCssTest::waitOnCkeditorInstance()
- AjaxCssTest::testCkeditorAjaxAddCss in core/
modules/ ckeditor/ tests/ src/ FunctionalJavascript/ AjaxCssTest.php - Tests adding style sheets dynamically to CKEditor.
File
- core/
modules/ ckeditor/ tests/ src/ FunctionalJavascript/ AjaxCssTest.php, line 114
Class
- AjaxCssTest
- Tests delivery of CSS to CKEditor via AJAX.
Namespace
Drupal\Tests\ckeditor\FunctionalJavascriptCode
protected function waitOnCkeditorInstance($instance_id, $timeout = 10000) {
$condition = <<<JS
(function() {
return (
typeof CKEDITOR !== 'undefined'
&& typeof CKEDITOR.instances["{<span class="php-variable">$instance_id</span>}"] !== 'undefined'
&& CKEDITOR.instances["{<span class="php-variable">$instance_id</span>}"].instanceReady
);
}());
JS;
$this
->getSession()
->wait($timeout, $condition);
}