Closed alemangui closed 8 years ago
Hey, just chiming in to see if you had any remarks. I'd be happy to discuss and/or consider another approach.
Can you remove all of the code in distribution please just leave the src code
I had deleted the fork on which I based this PR a while ago. I made a new fork/PR in #501
Cheers
Closed due to #501
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
el
is an unordered list<ul>
, we can't achieve readonliness for checkboxes at theel
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 theinitialize
function, I've created asetElAttributes
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.