Merge ecff05833b17d2e64ae5b932421136becf405da6 into 71d979ad61454fa6262f97dd0e0f56420bbecd0a

This commit is contained in:
Curtis Badke 2016-02-12 18:17:46 +00:00
commit 876798baf8
3 changed files with 17 additions and 8 deletions

View File

@ -78,6 +78,7 @@ simplemde.value("This text will appear in the editor");
- **code** Can be set to ```` ``` ```` or `~~~`. Defaults to ```` ``` ````.
- **italic** Can be set to `*` or `_`. Defaults to `*`.
- **element**: The DOM element for the textarea to use. Defaults to the first textarea on the page.
- **forceSync**: If set to `true`, force text changes made in SimpleMDE to be immediately stored in original textarea. Defaults to `false`.
- **hideIcons**: An array of icon names to hide. Can be used to hide specific icons shown by default without completely customizing the toolbar.
- **indentWithTabs**: If set to `false`, indent using spaces instead of tabs. Defaults to `true`.
- **initialValue**: If set, will customize the initial value of the editor.
@ -120,6 +121,7 @@ var simplemde = new SimpleMDE({
italic: "_"
},
element: document.getElementById("MyID"),
forceSync: true,
hideIcons: ["guide", "heading"],
indentWithTabs: false,
initialValue: "Hello world!",

16
dist/simplemde.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1484,6 +1484,13 @@ SimpleMDE.prototype.render = function(el) {
placeholder: options.placeholder || el.getAttribute("placeholder") || ""
});
if(options.forceSync === true) {
var cm = this.codemirror;
cm.on("change", function() {
cm.save();
});
}
this.gui = {};
if(options.toolbar !== false) {