From 1c1f3fdecddbf880b4744a43c41877ad3ddd0779 Mon Sep 17 00:00:00 2001 From: Wes Cossick Date: Sat, 11 Jul 2015 10:09:02 -0500 Subject: [PATCH] Add event handling to README --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 5664efe..922da8b 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,16 @@ Or, you can keep the height static: } ``` +## Event handling +You can catch the following list of events: https://codemirror.net/doc/manual.html#events + +``` +var simplemde = new SimpleMDE(); +simplemde.codemirror.on("change", function(){ + console.log(simplemde.value()); +}); +``` + ## How it works SimpleMDE is an improvement of [lepture's Editor project](https://github.com/lepture/editor) and includes a great many number of changes. It is bundled with [CodeMirror](https://github.com/codemirror/codemirror) and depends on [Font Awesome](http://fortawesome.github.io/Font-Awesome/).