2
0
mirror of https://github.com/Ionaru/easy-markdown-editor synced 2025-07-02 23:54:28 -06:00

Small fix

This commit is contained in:
Fernando Mendes 2015-08-11 09:25:29 +01:00
parent 8e877a70d8
commit d02aa31c23

View File

@ -467,10 +467,17 @@ function SimpleMDE(options) {
options.status = ['autosave', 'lines', 'words', 'cursor']; options.status = ['autosave', 'lines', 'words', 'cursor'];
} }
this.options = options; this.options = options;
// If user has passed an element, it should auto rendered // If user has passed an element, it should auto rendered
this.render(); this.render();
// The codemirror component is only available after rendering
// so, the setter for the defaultValue can only run after
// the element has been rendered
if (options.defaultValue) {
this.value(options.defaultValue);
}
} }
/** /**