Skip to content

Commit

Permalink
Added event to manipulate CKEditor config before initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
adamwojs committed Jan 12, 2024
1 parent 2ba22d5 commit a3d15cb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const VIEWPORT_TOP_OFFSET_DISTRACTION_FREE_MODE = 0;
section.appendChild(doc.createElement('p'));
}

CKEditor.create(container, {
const config = {
initialData: section.innerHTML,
plugins: [
Essentials,
Expand Down Expand Up @@ -216,7 +216,15 @@ const VIEWPORT_TOP_OFFSET_DISTRACTION_FREE_MODE = 0;
content: locale.language,
},
...extraConfig,
}).then((editor) => {
};

const event = new CustomEvent("ibexa-ckeditor:configure", {
detail: { container, config }
})

global.dispatchEvent(event);

CKEditor.create(container, config).then((editor) => {
this.editor = editor;

const editableElement = this.editor.editing.view.getDomRoot();
Expand Down

0 comments on commit a3d15cb

Please sign in to comment.