Skip to content

Conversation

@alemangui
Copy link
Contributor

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 the readonlyTemplate.

There's one exception: Checkboxes editor. Since the containing el is an unordered list <ul>, we can't achieve readonliness for checkboxes at the el level. The Checkboxes editor implements readonliness inside the _arrayToHtml function.

* setElAttributes function for tweaking the el*

Instead of having code altering the el attributes in the initialize function, I've created a setElAttributes function 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.

@alemangui
Copy link
Contributor Author

Hey, just chiming in to see if you had any remarks. I'd be happy to discuss and/or consider another approach.

@exussum12
Copy link
Collaborator

Can you remove all of the code in distribution please just leave the src code

@alemangui
Copy link
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

@exussum12 exussum12 closed this Mar 21, 2016
@exussum12
Copy link
Collaborator

Closed due to #501

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants