Added to docs: Setting the editor content and refreshing the editor#69
Added to docs: Setting the editor content and refreshing the editor#69srinathh wants to merge 1 commit intolepture:masterfrom
Conversation
…or. Added link to font file 1. If you are self-hosting the Editor vs. linking to it, you additionally need the icon font file if you are using the toolbar. Added link 2. To set the content programmatically instead of picking up from text area, we can use editor.codemirror.setValue 3. If there are changes in sizes or hiding/unhiding of editor, we need to call editor.codemirror.refresh to make things look correct
|
@srinathh I've added a shortcut for setting and getting values: https://github.com/lepture/editor/blob/master/src/editor.js#L216 |
|
@lepture Ok thanks - will use them! However, i still think these shortcuts The other point on Refresh is something which i encountered yesterday On Mon Dec 29 2014 at 2:32:39 PM Hsiaoming Yang notifications@github.com
|
|
@srinathh Yes, you are absolutely right. I'll sort it out soon. |
|
This already helped! Thanks. |
|
Thanks! On Mon, Dec 29, 2014, 2:32 PM Hsiaoming Yang notifications@github.com
|
editor.codemirror.setValue(). This is currently not mentioned in the documentationeditor.codemirror.refresh()programmatically after the visibility/sizing is complete to make things look correctly. This is also documented in the CodeMirror API documentation