1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-07-24 07:39:42 +02:00
codex.docs/src/frontend/js/modules/writing.js

30 lines
633 B
JavaScript
Raw Normal View History

/**
* Module for pages create/edit
*/
export default class Writing {
constructor(){
this.editorWrapper = null;
this.editor = null;
}
/**
* Called by ModuleDispatcher to initialize module from DOM
*/
init(config, moduleEl) {
this.editorWrapper = document.createElement('div');
this.editorWrapper.id = 'codex-editor';
moduleEl.appendChild(this.editorWrapper);
this.loadEditor().then((editor) => {
this.editor = editor;
})
};
async loadEditor(){
const {default: Editor} = await import(/* webpackChunkName: "editor" */ './../classes/editor');
return new Editor();
}
}