Read only modeSee original GitHub issue
Add the ability to enable read-only mode. We need to support initialization in read-only mode and toggling read-only mode on the fly.
For each plugin in list:
Improve Tools design that can be represented as WYSIWYG
readOnlyboolean flag in tools constructor and save it to the class’s property.
Separate event bindings and
contenteditableattributes activating to the
toggleReadonly(status)method. Call this method with
truestatus on the render in read-only mode. Also, this method can be called with
true/falsestatuses by editorjs core — it should bind/unbind events corresponded by status.
Working with editor.js core:
readOnlyoption to the Editor Config
readonly.tsmodule that will store
readOnlyEnabledproperty and have
readonly.tsmodule will call
toggleReadonly(status)methods of each editor module implemented this method.
toggleReadonly(status)method in modules that requires some readonly toggling logic:
API. This method will do two things: bind/unbind events and make/remove dom elements.
If some module makes own ui and bind events in
preparemethod (for example,
Toolbar): move events binding and ui making in
toggleReadonly()method of this module. Then call
readOnlyoption to Tools constructor on render
If some of Tools does not provide read-only functionality (can be detected by
toggleReadonly () implemented or not), throw an error on trying to enable read-only mode.
toggleReadonly()method to the public API. This method will call
- Created 4 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
@startupgurukul you can boost development by donation to maintainers https://opencollective.com/editorjs
I’ve updated the description of the issue with more details. We are looking for contributors who can implement some of the subtasks with our help.