Changes between Initial Version and Version 1 of Ticket #9814, comment 12


Ignore:
Timestamp:
May 8, 2014, 8:54:34 AM (11 years ago)
Author:
Bram
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #9814, comment 12

    initial v1  
    11Replying to [comment:11 Reinmar]:
    22> Editor starts in read only mode and that mode is not refreshed (because how could it be) when container's visibility is changed.
    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.
     3Having 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.
     4If 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
     6What 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{{{
     9var editor = CKEDITOR.inline("editorID", config);
     10
     11editor.on('focus', function () {
     12    editor.setReadOnly(false);
     13});
     14}}}
     15
     16A 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.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy