All editors have readonly mode#452
Closed
alemangui wants to merge 1 commit intopowmedia:masterfrom
alemangui:readonly
Closed
All editors have readonly mode#452alemangui wants to merge 1 commit intopowmedia:masterfrom alemangui:readonly
alemangui wants to merge 1 commit intopowmedia:masterfrom
alemangui:readonly
Conversation
Contributor
Author
|
Hey, just chiming in to see if you had any remarks. I'd be happy to discuss and/or consider another approach. |
Collaborator
|
Can you remove all of the code in distribution please just leave the src code |
Contributor
Author
|
I had deleted the fork on which I based this PR a while ago. I made a new fork/PR in #501 Cheers |
Collaborator
|
Closed due to #501 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi guys,
I've taken a shot at the readonly mode on editors (Briefly discussed in issues 90, 91 and 145) and here's a pull request proposal.
readonly in schema
Each editor can get a
{ readonly: true }as part of the schema (false by default). Object doesn't have readonliness since it's the subschema which would specify the readonliness for each editor.* readonlyTemplate for each editor*
Each editor has a
readonlyTemplate, which is rendered if the schema.readonly property is set. This way it is easy to extend an editor to make it appear however we want only by overriding thereadonlyTemplate.There's one exception: Checkboxes editor. Since the containing
elis an unordered list<ul>, we can't achieve readonliness for checkboxes at theellevel. The Checkboxes editor implements readonliness inside the_arrayToHtmlfunction.* setElAttributes function for tweaking the el*
Instead of having code altering the
elattributes in theinitializefunction, I've created asetElAttributesfunction which can also be called after the readonly template is rendered.That's it, let me know what you think and if the PR is accepted I'll update the Readme.md as well as the fiddles linked in it.