mirror of
https://github.com/sparksuite/simplemde-markdown-editor.git
synced 2025-09-24 16:40:55 -06:00
Merge d9d739661259106aa606227a819b12026b4e6b20 into e32fe3f91c2d45f27f72a3662133b1c0e1a5bda1
This commit is contained in:
commit
53aacde3b5
18
README.md
18
README.md
@ -319,6 +319,24 @@ simplemde.isSideBySideActive(); // returns boolean
|
|||||||
simplemde.isFullscreenActive(); // returns boolean
|
simplemde.isFullscreenActive(); // returns boolean
|
||||||
simplemde.clearAutosavedValue(); // no returned value
|
simplemde.clearAutosavedValue(); // no returned value
|
||||||
```
|
```
|
||||||
|
## jQuery validation
|
||||||
|
To mimic the jQuery validation on the editor, you can use the following code.
|
||||||
|
|
||||||
|
```js
|
||||||
|
editor.codemirror.on("change", function() {
|
||||||
|
var element = $(editor.element);
|
||||||
|
$(element).val(editor.value());
|
||||||
|
$(element).trigger('keyup');
|
||||||
|
});
|
||||||
|
|
||||||
|
editor.codemirror.on("focus", function() {
|
||||||
|
$(editor.element).trigger('focus');
|
||||||
|
});
|
||||||
|
|
||||||
|
editor.codemirror.on("blur", function() {
|
||||||
|
$(editor.element).trigger('blur');
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
## How it works
|
## How it works
|
||||||
SimpleMDE began as an improvement of [lepture's Editor project](https://github.com/lepture/editor), but has now taken on an identity of its own. It is bundled with [CodeMirror](https://github.com/codemirror/codemirror) and depends on [Font Awesome](http://fontawesome.io).
|
SimpleMDE began as an improvement of [lepture's Editor project](https://github.com/lepture/editor), but has now taken on an identity of its own. It is bundled with [CodeMirror](https://github.com/codemirror/codemirror) and depends on [Font Awesome](http://fontawesome.io).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user