3 | | Having to watch the visibility of each element would indeed be a hassle (is this is even possible without polling?). As far as I know the only way to make the editor's control bar to appear is when you focus the content-editable element. If this is the case, the focus event could be used to refresh the '''isReadOnly''' check and render the control bar correctly based on the element's current visibility. |
| 3 | Having to watch the visibility of each element would indeed be a hassle (is this is even possible without polling?). As far as I know the only way to make the editor's control bar to appear is when you focus the content-editable element. |
| 4 | If this is the case, the focus event could be used to refresh the '''isReadOnly''' check and render the control bar correctly based on the element's current visibility. |
| 5 | |
| 6 | What I ended up doing is forcing the editor out of read-only mode when it gets focused. No the cleanest solution but it works for my use case. For anyone else interested, an example below: |
| 7 | |
| 8 | {{{ |
| 9 | var editor = CKEDITOR.inline("editorID", config); |
| 10 | |
| 11 | editor.on('focus', function () { |
| 12 | editor.setReadOnly(false); |
| 13 | }); |
| 14 | }}} |
| 15 | |
| 16 | A better solution would be to use CKEditor's build in '''isReadOnly''' function whenever an inline editor gets focused and set read only mode accordingly in the background. If you can point me in the right direction on where I can implement this, I would be happy to hack on this and send you a pull request on Github. |