codex-team / codex-team/editor.js
Toggle a readOnly utility class on holder element
- Dominant language
- TypeScript
- Stars
- 31.9k
- Forks
- 2.2k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
1. Describe a problem.
EditorJS adds a 50px margin-right to `.codex-editor__redactor`. We're using readOnly mode to display output for non-authenticated users. This margin is not required in readOnly mode. There are many ways to overcome this but they all require boilerplate code for each instance of EditorJS. We use many instances and it's an unnecessary ball-ache to do for each instance whilst maintaining consistency between modules.
2. Describe the solution you'd like. Mockups are welcome.
Toggle a class on the `holder` element when readOnly mode is changed. Add `.ce-read-only` for readOnly, remove it when the editor becomes editable. This way we can simply handle the presentation issue in a global CSS file and be done with it.
3. Are there any alternatives?
Emit a `contentEditable` event when the readOnly config changes that we can subscribe to for each instance (not great because we still need to write code to add / remove classes)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.