Improved styling of the label dialog editor, so that the appearance is closer to the Label result

This commit is contained in:
Jan Böhmer 2022-09-21 21:49:09 +02:00
parent 9c87202509
commit ab8be58c0d
6 changed files with 33 additions and 4 deletions

View file

@ -6,6 +6,7 @@ import { default as HTMLLabelEditor } from "../../ckeditor/html_label";
import EditorWatchdog from '@ckeditor/ckeditor5-watchdog/src/editorwatchdog';
import "../../css/ckeditor.css";
/* stimulusFetch: 'lazy' */
export default class extends Controller {
@ -43,6 +44,13 @@ export default class extends Controller {
editor.enableReadOnlyMode("readonly");
}
//Apply additional styles
const editor_div = editor.ui.view.element;
const new_classes = this.element.dataset.ckClass;
if (editor_div && new_classes) {
editor_div.classList.add(...new_classes.split(","));
}
console.log(editor);
})
.catch(error => {