Commit f3495e7e authored by eileen's avatar eileen 🎱
Browse files

Merge branch 'css' into 'master'

Add css to prevent ckeditor from going too wide.

See merge request extensions/ckeditor5!1
parents 005ee4d1 3e899d59
......@@ -144,9 +144,12 @@ function ckeditor5_civicrm_themes(&$themes) {
/**
* Implements hook_civicrm_coreResourceList
*
* Add TinyMCE javascript.
* Add ckeditor5.
*
* @link http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_coreResourceList
*
* @param array $items
* @param array $region
*/
function ckeditor5_civicrm_coreResourceList(&$items, $region) {
if ($region === 'html-header') {
......@@ -162,6 +165,7 @@ function ckeditor5_civicrm_coreResourceList(&$items, $region) {
],
];
CRM_Core_Resources::singleton()->addStyleUrl(CRM_Core_Resources::singleton()->getUrl('ckeditor5', 'js/elFinder/css/elfinder.min.css'));
CRM_Core_Resources::singleton()->addStyleUrl(CRM_Core_Resources::singleton()->getUrl('ckeditor5', 'css/ckeditor.css'));
}
if (Civi::settings()->get('editor_id') === 'CKEditor5-base64') {
......@@ -175,7 +179,7 @@ function ckeditor5_civicrm_coreResourceList(&$items, $region) {
'ELFinderConnnector' => NULL,
],
];
CRM_Core_Resources::singleton()->addStyleUrl(CRM_Core_Resources::singleton()->getUrl('ckeditor5', 'js/elFinder/css/elfinder.min.css'));
CRM_Core_Resources::singleton()->addStyleUrl(CRM_Core_Resources::singleton()->getUrl('ckeditor5', 'css/ckeditor.css'));
}
}
......
/* Set the height of the editor */
.ck-editor__editable_inline {
min-height: 20px;
}
/* Set the width of the editor */
.ck.ck-editor {
max-width: 95%;
}
......@@ -238,6 +238,11 @@
// has no toolbar by default (as opposed to the elfinder which leverages the classic-build')
ClassicEditor.create($(item)[0], {
toolbar: {
// With this it wraps rather than offering a drop down for more.
// I'm on the fence about which is better but this is consistent with
// ckeditor4. If we added configurability we could expose this.
// https://ckeditor.com/docs/ckeditor5/latest/api/module_core_editor_editorconfig-EditorConfig.html#member-toolbar
shouldNotGroupWhenFull: true,
items: [
'heading',
'|',
......@@ -248,12 +253,14 @@
'superscript',
'subscript',
'highlight',
'|',
'removeFormat',
'specialCharacters',
'fontFamily',
'fontColor',
'fontBackgroundColor',
'fontSize',
'|',
'bulletedList',
'numberedList',
'|',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment